How do I properly build Android OpenCV from sources?
The end goal is to build opencv with contrib for Android, but i cant seem to get the build_sdk.py script to even work without the --extra_pack flag
I've downloaded build Tools 25.0.3, sdk tools 25.2.5,, ndk 16b and the latest opencv and contrib repos.
Commands:
export ANDROID_SDK=/home/wmmc88/Android/Sdk/
export ANDROID_NDK=/home/wmmc88/Android/android-ndk-r16b/
python3 ../android/build_sdk.py test/ ../../../opencv --no_ccache --config ../android/ndk-16.config.py
Output:
> Args: Namespace(build_doc=False,
> config='../android/ndk-16.config.py',
> extra_modules_path=None,
> extra_pack=None, force_copy=False,
> force_opencv_toolchain=False,
> ndk_path=None, no_ccache=True,
> opencv_dir='../../../opencv',
> sdk_path=None, sign_with=None,
> work_dir='test/') Package
> configuration:
> ================================================================================ ABIs = [
> ABI("2", "armeabi-v7a", "arm-linux-androideabi-4.9",
> cmake_vars=dict(ANDROID_ABI='armeabi-v7a
> with NEON')),
> ABI("1", "armeabi", "arm-linux-androideabi-4.9",
> cmake_vars=dict(WITH_TBB='OFF')),
> ABI("3", "arm64-v8a", "aarch64-linux-android-4.9"),
> ABI("5", "x86_64", "x86_64-4.9"),
> ABI("4", "x86", "x86-4.9"), ]
> ================================================================================ Android NDK path:
> /home/wmmc88/Android/android-ndk-r16b/
> Android SDK path:
> /home/wmmc88/Android/Sdk/ Check dir
> /home/wmmc88/OpenCVRepo/opencv/platforms/Custom/test
> (create: True, clean: False) Check dir
> /home/wmmc88/OpenCVRepo/opencv
> (create: False, clean: False) Check
> dir
> /home/wmmc88/OpenCVRepo/opencv/platforms/Custom/test/o4a
> (create: True, clean: True) Removing
> file:
> /home/wmmc88/OpenCVRepo/opencv/platforms/Custom/test/o4a/CMakeCache.txt
> Removing dir:
> /home/wmmc88/OpenCVRepo/opencv/platforms/Custom/test/o4a/CMakeFiles
> Removing dir:
> /home/wmmc88/OpenCVRepo/opencv/platforms/Custom/test/o4a/3rdparty
> Removing file:
> /home/wmmc88/OpenCVRepo/opencv/platforms/Custom/test/o4a/CMakeDownloadLog.txt
> Removing dir:
> /home/wmmc88/OpenCVRepo/opencv/platforms/Custom/test/o4a/junk
> Check dir
> /home/wmmc88/OpenCVRepo/opencv/platforms/Custom/test/OpenCV-android-sdk
> (create: True, clean: True) Removing
> dir:
> /home/wmmc88/OpenCVRepo/opencv/platforms/Custom/test/OpenCV-android-sdk/sdk
> Check dir
> /home/wmmc88/OpenCVRepo/opencv/platforms/Custom/test/OpenCV-android-sdk/sdk/java/javadoc
> (create: True, clean: True) Detected
> OpenCV version: 4.0.0-pre Detected
> Engine version: 3.42 Check dir
> /home/wmmc88/OpenCVRepo/opencv/platforms/Custom/test/build_service_armeabi-v7a
> (create: True, clean: True)
> =====
> ===== Building library for armeabi-v7a (arm-linux-androideabi-4.9)
> =====
>
> Executing: ['cmake', '-GNinja',
> '-DBUILD_TESTS=ON',
> '-DINSTALL_TESTS=ON',
> "-DCMAKE_TOOLCHAIN_FILE='/home/wmmc88/Android/android-ndk-r16b/build/cmake/android.toolchain.cmake'",
> "-DWITH_OPENCL='OFF'",
> "-DWITH_IPP='OFF'", "-DWITH_TBB='ON'",
> "-DBUILD_EXAMPLES='OFF'",
> "-DBUILD_TESTS='OFF'",
> "-DBUILD_PERF_TESTS='OFF'",
> "-DBUILD_DOCS='OFF'",
> "-DBUILD_ANDROID_EXAMPLES='ON'",
> "-DINSTALL_ANDROID_EXAMPLES='ON'",
> "-DANDROID_STL='gnustl_static'",
> "-DANDROID_ABI='armeabi-v7a with
> NEON'",
> "-DANDROID_TOOLCHAIN_NAME='arm-linux-androideabi-4.9'",
> "-DANDROID_PLATFORM_ID='2'",
> '/home/wmmc88/OpenCVRepo/opencv']
> Executing: cmake -GNinja
> -DBUILD_TESTS=ON -DINSTALL_TESTS=ON -DCMAKE_TOOLCHAIN_FILE='/home/wmmc88/Android/android-ndk-r16b/build/cmake/android.toolchain.cmake'
> -DWITH_OPENCL='OFF' -DWITH_IPP='OFF' -DWITH_TBB='ON' -DBUILD_EXAMPLES='OFF' -DBUILD_TESTS='OFF' -DBUILD_PERF_TESTS='OFF' -DBUILD_DOCS='OFF' -DBUILD_ANDROID_EXAMPLES='ON' -DINSTALL_ANDROID_EXAMPLES='ON' -DANDROID_STL='gnustl_static' -DANDROID_ABI='armeabi-v7a with NEON' -DANDROID_TOOLCHAIN_NAME='arm-linux-androideabi-4.9'
> -DANDROID_PLATFORM_ID='2' /home/wmmc88 ...