Fix Android NDK 22 build error#19501
Conversation
| set(ANDROID_GRADLE_PLUGIN_VERSION "4.0.1" CACHE STRING "Android Gradle Plugin version (4.0.1)") | ||
| message(STATUS "Android Gradle Plugin version: ${ANDROID_GRADLE_PLUGIN_VERSION}") | ||
|
|
||
| set(GRADLE_VERSION "6.1.1" CACHE STRING "Gradle version (6.1.1)") |
There was a problem hiding this comment.
What prevent from using most recent 6.8.2 ?
There was a problem hiding this comment.
What prevent from using most recent 6.8.2 ?
Nothing - I'm just proposing a PR to fix this one particular issue. If you want to propose a PR to bring the OpenCV Android implementation up to the bleeding edge (maybe add some Kotlin extensions as well) then please go ahead 😃
| @@ -1,7 +1,10 @@ | |||
| # https://developer.android.com/studio/releases/gradle-plugin | |||
| set(ANDROID_GRADLE_PLUGIN_VERSION "3.2.1" CACHE STRING "Android Gradle Plugin version (3.0+)") | |||
| set(ANDROID_GRADLE_PLUGIN_VERSION "4.0.1" CACHE STRING "Android Gradle Plugin version (4.0.1)") | |||
There was a problem hiding this comment.
What prevent from using most recent 4.1.2 ?
|
relates #19048 |
platforms/android/build_sdk.py
Outdated
|
|
||
| android_sdkmanager = os.path.join(os.environ['ANDROID_SDK'], 'tools', 'bin', 'sdkmanager') | ||
| accept_licenses_proc = subprocess.Popen(['yes | ' + android_sdkmanager + ' --licenses'], shell=True) | ||
| log.debug('yes | ' + android_sdkmanager + ' --licenses') |
There was a problem hiding this comment.
- This must be done by User before running this script. At least not implicitly in automatic mode.
- This would not work on Windows.
There was a problem hiding this comment.
@alalek I wasn't intending to leave this code in. It was just an attempt to get the failing build to pass. (Which anyway doesn't seem to have worked.) I will revert it.
|
My suggestion is to keep "existed" versions in CMake file and put new versions values into the new |
a7ef72b to
107f233
Compare
|
There is a related issue: Android NDK 22 may link to libz.a instead of libz.so for imgcodecs module (static lib), leading to link error (libz.a not found) on machines without same NDK version installed in same directory. PR #19522 fix that issue. To finally build a correct OpenCV Android package, I think #19521 #19522 and current PR #19501 are all required and should be merge in this order. Correct me if I made any mistake guess. |
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Fix for #19500