Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cmake/make build of opencv320 for android in Windows 10

( I don't know if it is the right place to post it, so please point me in the right direction if not so.)

Has anyone succeeded to build openCV for android in Windows 10 with cmake/make in a clean manner? My goal is to generate libopencv_java3.so and the java classes.

I succeeded with the official 3.20 package, but only after some errors here and there, having to figure how to prevent the error shown, sometimes in source code, ... So it is ok since now I have it working, but in the future I will need to customize quite often the C code, and build the libs again. I would like to be able to do this process without intermediate errors.

On the other hand, I read posts of people that have been able to build it totally "clean" just following the same process than me (build opencv from trunk)

For instance, one of the errors I am getting now in the make process is (after git cloning opencv and trying with different commits)

C:\Develop\git\opencv_320\build4>cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=..\platforms\android\android.toolchain.cmake .. (this works ok) C:\Develop\git\opencv_320\build4>make (always stops at about 85%, with this error)

.... [ 85%] Generating jni/photo.cpp [ 85%] Generating jni/video.cpp [ 85%] Generating jni/imgcodecs.cpp [ 85%] Generating jni/videoio.cpp [ 86%] Generating jni/features2d.cpp [ 86%] Generating OpenCV Android library project. SDK target: android-23 make[2]: * [build.xml] Error 2 make[1]: [modules/java/CMakeFiles/opencv_java.dir/all] Error 2 make: ** [all] Error 2

In short, is it possible that the success of the cmake/make process (in Windows 10) could depend on the versions of the installed tools (cmake, make, NDK, ...., and the ENV variables)? It would be of great help, in order to be able to compare and have a known starting point, to have a checklist of a "working set" of tools (cmake, make, ndk, whatever...) I mean its versions, System environment variables, and whatever can affect the build process.

cmake/make build of opencv320 for android in Windows 10

( I don't know if it is the right place to post it, so please point me in the right direction if not so.)

Has anyone succeeded to build openCV for android in Windows 10 with cmake/make in a clean manner? My goal is to generate libopencv_java3.so and the java classes.

I succeeded with the official 3.20 package, but only after some errors here and there, having to figure how to prevent the error shown, sometimes in source code, ... So it is ok since now I have it working, but in the future I will need to customize quite often the C code, and build the libs again. I would like to be able to do this process without intermediate errors.

On the other hand, I read posts of people that have been able to build it totally "clean" just following the same process than me (build opencv from trunk)

For instance, one of the errors I am getting now in the make process is (after git cloning opencv and trying with different commits)

C:\Develop\git\opencv_320\build4>cmake

  • C:\Develop\git\opencv_320\build4>cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=..\platforms\android\android.toolchain.cmake -DCMAKE_TOOLCHAIN_FILE=..\platforms\android\android.toolchain.cmake .. (this works ok) C:\Develop\git\opencv_320\build4>make ok)
  • C:\Develop\git\opencv_320\build4>make (always stops at about 85%, with this this error)

    ....

....
[ 85%] Generating jni/photo.cpp jni/photo.cpp
[ 85%] Generating jni/video.cpp jni/video.cpp
[ 85%] Generating jni/imgcodecs.cpp jni/imgcodecs.cpp
[ 85%] Generating jni/videoio.cpp jni/videoio.cpp
[ 86%] Generating jni/features2d.cpp jni/features2d.cpp
[ 86%] Generating OpenCV Android library project. SDK target: android-23 android-23
make[2]: * [build.xml] Error 2 2
make[1]:
[modules/java/CMakeFiles/opencv_java.dir/all] Error 2 2
make: *
* [all] Error 2

In short, is it possible that the success of the cmake/make process (in Windows 10) could depend on the versions of the installed tools (cmake, make, NDK, ...., and the ENV variables)? It would be of great help, in order to be able to compare and have a known starting point, to have a checklist of a "working set" of tools (cmake, make, ndk, whatever...) I mean its versions, System environment variables, and whatever can affect the build process.

[Solved] cmake/make build of opencv320 for android in Windows 10

( I don't know if it is the right place to post it, so please point me in the right direction if not so.)

Has anyone succeeded to build openCV for android in Windows 10 with cmake/make in a clean manner? My goal is to generate libopencv_java3.so and the java classes.

I succeeded with the official 3.20 package, but only after some errors here and there, having to figure how to prevent the error shown, sometimes in source code, ... So it is ok since now I have it working, but in the future I will need to customize quite often the C code, and build the libs again. I would like to be able to do this process without intermediate errors.

On the other hand, I read posts of people that have been able to build it totally "clean" just following the same process than me (build opencv from trunk)

For instance, one of the errors I am getting now in the make process is (after git cloning opencv and trying with different commits)

  • C:\Develop\git\opencv_320\build4>cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=..\platforms\android\android.toolchain.cmake .. (this works ok)
  • C:\Develop\git\opencv_320\build4>make (always stops at about 85%, with this error)

....
[ 85%] Generating jni/photo.cpp
[ 85%] Generating jni/video.cpp
[ 85%] Generating jni/imgcodecs.cpp
[ 85%] Generating jni/videoio.cpp
[ 86%] Generating jni/features2d.cpp
[ 86%] Generating OpenCV Android library project. SDK target: android-23
make[2]: * [build.xml] Error 2
make[1]:
[modules/java/CMakeFiles/opencv_java.dir/all] Error 2
make: *
* [all] Error 2

In short, is it possible that the success of the cmake/make process (in Windows 10) could depend on the versions of the installed tools (cmake, make, NDK, ...., and the ENV variables)? It would be of great help, in order to be able to compare and have a known starting point, to have a checklist of a "working set" of tools (cmake, make, ndk, whatever...) I mean its versions, System environment variables, and whatever can affect the build process.