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

opencv build fails with latest sdk in ubuntu 64 bit : Android SDK Tools: OpenCV requires Android SDK Tools revision 14 or newer. #18131

Closed
YounGCoder09 opened this issue Aug 18, 2020 · 11 comments
Labels
category: build/install feature incomplete needs investigation Collect and attach more details (build flags, stacktraces, input dumps, etc) platform: android priority: low
Milestone

Comments

@YounGCoder09
Copy link

-- Android SDK Build Tools: ver. 30.0.0-rc4 (subdir 30.0.0-rc4 from 30.0.0-rc4)
CMake Error at cmake/android/OpenCVDetectAndroidSDK.cmake:176 (message):
Android SDK Tools: OpenCV requires Android SDK Tools revision 14 or newer.

Use BUILD_ANDROID_PROJECTS=OFF to prepare Android project files without
building them
Call Stack (most recent call first):
CMakeLists.txt:780 (include)

related to : kivy/buildozer#1144

@YounGCoder09
Copy link
Author

@alalek its not incomplete nor needs further inverstigation , its trivial , you can check the workflow at https://github.com/tshirtman/test_p4a_opencv/actions/runs/214390204 , and you can see the same error

@tshirtman
Copy link

Seems this steems from outdated logic about gradle/ant build in the OpenCVDetectAndroidSDK.cmake file, trying with some more patching of the file in the recipe and to remove the tests and force gradle build.

@abhishekju06
Copy link

abhishekju06 commented Dec 17, 2020

Can anyone please help? I am encountering the exact same error and struggling for 4 days but with no improvement.Please help.

@snuq
Copy link

snuq commented Dec 19, 2020

Also struggling with this issue, really dont understand where to even start looking for a solution or fix... any help would be appreciated

@alalek
Copy link
Member

alalek commented Dec 19, 2020

OpenCV is not tested and probably doesn't support modern Android SDK/NDK versions. So try tools from 2018-2019 first.

Unfortunately, there are no active Android users in OpenCV development team.

If you are Android expert then feel free to contribute through Pull Requests.
Also investigation with follow-up comment with the clear reason of the problem is very useful.


BTW, there is an example of configuration output from validation builds on public CI:

-- Android SDK Tools: ver. 26.1.1 (description: 'Android SDK Tools')
-- Android SDK Build Tools: ver. 28.0.3 (subdir 28.0.3 from 28.0.3)
-- Android SDK Tools: Ant (Eclipse) builds are NOT supported by Android SDK
-- Android SDK Build Tools: Gradle 3.0.0+ builds support is available
-- Android SDK Tools: Prepare Android projects for using Gradle 3.0.0+ build scripts
-- Android Gradle Plugin version: 3.2.1

...

--   Android NDK:                   /opt/android/android-ndk-r18b (ver 18.1.5063045)
--     Android ABI:                 armeabi-v7a
--     NDK toolchain:               arm-linux-androideabi-clang
--     STL type:                    c++_static
--     Native API level:            21
--   Android SDK:                   /opt/android/android-sdk.gradle (tools: 26.1.1 build tools: 28.0.3)

@vjeranc
Copy link

vjeranc commented Jan 3, 2021

@alalek I tried it with the newest NDK and the only thing I needed to use was the android.toolchain.cmake supplied by the NDK. The one inside platforms directory does not work.

After that I just ran the apps on my phone and everything looked well.

@abhishekju06
Copy link

@alalek I tried it with the newest NDK and the only thing I needed to use was the android.toolchain.cmake supplied by the NDK. The one inside platforms directory does not work.

After that I just ran the apps on my phone and everything looked well.

Can you please explain me the steps?
I need to do it in android 9;API=28

@vjeranc
Copy link

vjeranc commented Jan 5, 2021

@abhishekju06 I left a comment on the official forums here.

@NguyenDuyKha
Copy link

Problem: Android SDK Tools not updated yet. Although Android SDK Build Tools already in high version. I think that .buildozer or sdkmanager has some problem so can't update. Try the following steps for manual installation:

Step 1: sudo apt update && sudo apt install android-sdk
Step 2: cp -i -R /usr/lib/android-sdk/tools/ ~/.buildozer/android/platform/android-sdk/tools/

(Replaceable /usr/lib/android-sdk/tools/ to /home/AccountName/Android/Sdk or /usr/lib/android-sdk or /Library/Android/sdk/ or /Users/[USER]/Library/Android/sdk )

Step 3: Delete folder .buildozer and bin in folder your project
Step 4: buildozer -v android debug

@widiba03304
Copy link

Setting -DANDROID_SDK_TOOLS_VERSION=... might help

@asmorkalov
Copy link
Contributor

Fixed in #21736

@asmorkalov asmorkalov added this to the 4.8.0 milestone Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: build/install feature incomplete needs investigation Collect and attach more details (build flags, stacktraces, input dumps, etc) platform: android priority: low
Projects
None yet
Development

No branches or pull requests

9 participants