By default, the official OpenCV Android SDK doesn’t contain the contrib libraries, like Aruco.


  • NDK r10e

  • Android SDK

Note: please degrade the Android SDK tools version, 25.2.4 is fine for me Go to ~/Library/Android/sdk, rename tools to tools.bak, then unzip the to sdk/tools directory. Why? because otherwise, android command has been deprecated)

  • opencv 3.3.1

git clone

  • opencv_contrib

git clone

  • CMake

brew install cmake ninja ant

How to do it

Assume the following is my unziped directories in my home.

$ ls

Then run these commands:

$ cd ~/opencv/ && mkdir build
$ cd ~/opencv/platforms/android
$ ./ --ndk_path ~/android-ndk-r10e --sdk_path ~/Library/Android/sdk --extra_modules_path ~/opencv_contrib/modules ~/opencv/build ~/opencv

Go to ~/opencv/build/sdk, you can see all are there.

That’s it. Bingo!