Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution for Building OpenCV on Termux by Disabling Android SDK and Java Support in CMake #1063

Open
4 tasks
ab2-g opened this issue Dec 17, 2024 · 2 comments
Open
4 tasks

Comments

@ab2-g
Copy link

ab2-g commented Dec 17, 2024

Expected behaviour

Write here how did you expect the library to function.

Actual behaviour

Write here what went wrong.

Steps to reproduce

  • example code
  • operating system
  • architecture (e.g. x86)
  • opencv-python version
Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python
@ab2-g
Copy link
Author

ab2-g commented Dec 17, 2024

Problem:

When trying to build OpenCV on Termux, the installation fails because CMake looks for Android SDK and Java tools, which are not available in Termux by default.

Solution:

To solve this issue, you can disable Android and Java support in CMake by using the following settings:

cmake -DANDROID=OFF -DBUILD_ANDROID_EXAMPLES=OFF -DBUILD_JAVA=OFF -DBUILD_FAT_JAVA_LIB=OFF -DWITH_OPENCL=OFF -DWITH_CUDA=OFF ..

This will allow OpenCV to be installed successfully in Termux without any issues related to missing Android SDK or Java.

Additional Details:

  • Operating System: Android (via Termux)
  • Architecture: ARM, x86, etc.
  • OpenCV Version: [mention the version you tested]

1 similar comment
@ab2-g
Copy link
Author

ab2-g commented Dec 17, 2024

Problem:

When trying to build OpenCV on Termux, the installation fails because CMake looks for Android SDK and Java tools, which are not available in Termux by default.

Solution:

To solve this issue, you can disable Android and Java support in CMake by using the following settings:

cmake -DANDROID=OFF -DBUILD_ANDROID_EXAMPLES=OFF -DBUILD_JAVA=OFF -DBUILD_FAT_JAVA_LIB=OFF -DWITH_OPENCL=OFF -DWITH_CUDA=OFF ..

This will allow OpenCV to be installed successfully in Termux without any issues related to missing Android SDK or Java.

Additional Details:

  • Operating System: Android (via Termux)
  • Architecture: ARM, x86, etc.
  • OpenCV Version: [mention the version you tested]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant