Search code examples
appium

Appium) Finishing setting up optional dependencies


First of all, below is required information.

OS: macOS Mojave 10.14.2
Node: 10.13.0
AndroidStudio: 3.1.4

When I run appium doctor, I'am getting two optional dependencies are missing.

1. `opencv4nodejs`
2. `bundletool.jar`

If I try to install opencv4nodejs, but I got warning:

[email protected] has no binaries

(It seems like auto build failed)

And I have no idea how to add export bundletool.jar as PATH.


Solution

  • I just ran into this myself. Installing opencv4nodejs was pretty easy - for that, I used:

    npm -g install opencv4nodejs
    

    There may have been dependencies of 'opencv4nodejs' that I had to install - I can't remember; that may have required me to install 'make' with brew install make

    The hard one was the bundletool.jar - here are the steps I followed for that:

    1. Searched for 'bundletool.jar' and found a place to download it from Google - I got 'bundletool-all-0.8.0.jar' from https://github.com/google/bundletool/releases
    2. I renamed this file to just 'bundletool.jar' and placed in my Android SDK folder, under its own sub-folder called 'bundle-tool' - full path: /Users/{USER}/Library/Developer/Android/sdk/bundle-tool
    3. I had to make the bundletool.jar executable with:

      chmod +x bundletool.jar

    4. Added the 'bundle-tool' folder to Path with the following addition in my ~/.bashrc file:

      PATH="$PATH:$ANDROID_HOME/bundle-tool"

    5. Now running which 'bundletool.jar' is happy and finds it in the 'bundle-tool' folder I created (see step 2)

    6. Running 'appium-doctor' is now satisfied - and doesn't report any missing dependencies.

    Hope that helps.

    2019-10-31 update:

    With MacOS Catalina (specifically 10.15.1) - I ran into a problem with installing opencv4nodejs using the npm command shown above. Opencv4nodejs wants to be built - but using C++ 11 features (from what I read) and has a problem with constexpr on MacOS. So, I first installed OpenCV with Brew - using brew install opencv@4 and then had to set the environment variable to not autobuild OpenCV with export OPENCV4NODEJS_DISABLE_AUTOBUILD=1 Then I was able to install opencv4nodejs with the npm command shown above - and appium-doctor shows that its dependencies are in place.