Skip to content

Switch to Android Build tools 34 and NDK 26d.#183

Merged
asmorkalov merged 3 commits intomainfrom
as/android_34
Dec 31, 2024
Merged

Switch to Android Build tools 34 and NDK 26d.#183
asmorkalov merged 3 commits intomainfrom
as/android_34

Conversation

@asmorkalov
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov commented Aug 26, 2024

@fengyuentau
Copy link
Copy Markdown
Member

Build error:

Args: Namespace(build_doc=True, config='/home/ci/opencv/platforms/android/default.config.py', debug=False, debug_info=False, disable=[], extra_modules_path=None, force_copy=False, force_opencv_toolchain=False, hwasan=False, modules_list=None, ndk_path='/opt/android-sdk/ndk/27.0.12077973', no_ccache=False, no_kotlin=False, no_media_ndk=False, no_samples_build=False, opencl=False, opencv_dir='/home/ci/opencv/platforms/android/../..', sdk_path='/opt/android-sdk', shared=False, sign_with=None, use_android_buildtools=False, work_dir='/home/ci/build')
Executing: ['ccache', '--version']
Result: ccache version 3.7.7
Traceback (most recent call last):
  File "/home/ci/opencv/platforms/android/build_sdk.py", line 446, in <module>
    raise Fail('Config "%s" is missing' % args.config)
__main__.Fail: Config "/home/ci/opencv/platforms/android/default.config.py" is missing

@asmorkalov
Copy link
Copy Markdown
Contributor Author

Added link to the main OpenCV PR. They need to be merged together.

@asmorkalov asmorkalov changed the title Switch to Android Build tools 35 and NDK 27. Switch to Android Build tools 34 and NDK 28b1. Dec 9, 2024
OS-pedrogustavobilro added a commit to OutSystems/card.io-Android-source that referenced this pull request Dec 10, 2024
* chore: Update submodule to forked repo

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Build on latest version of Android Studio

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* docs: Add README instructions on what to do to compile the SDK.

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: comment tests

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Update NDK to latest version

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Update OpenCV to latest version 4.10.0

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Remove tegra builds; no longer supported by NDK.

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Update card.io-dmz commit with C++ fixes

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Update README.md

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Ignore lint on SampleApp

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: OpenCV .so files built from source with 16KB page size support

References:

- opencv/opencv#26057
- opencv/ci-gha-workflow#183
- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Update README.md

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Smaller .so files for opencv library

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Update README.md

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Update dmz submodule.

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Update dmz submodule.

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Remove unnecessary configs from gradle

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Instrumented tests

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Update Sample App

Up to Android 14. Failing to compile with compileSdk=35 and edge-to-edge (targerSdkVersion=35) was fixed in cordova plugin, not here.

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Uncomment lint check

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Accessing versionName via BuildConfig

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Update release version

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Cleanup CHANGELOG.md

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Update gradle version to latest

Also involved some fixes given there were breaking changes with the update of gradle / agp (7.X to 8.X)

- Update JDK from 11 to 17
- Update build tools version to latest
- Add namespace to gradle modules
- Explicitly enable buildConfig in card.io module
- Update way of setting classifier for gradle tasks

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Remove unnecessary Ruby releasinator

Used by the upstream card.io repo, not needed here. Fixes snyk issue.

References:

- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment
OS-pedrogustavobilro added a commit to OutSystems/cardio-cordova-plugin that referenced this pull request Dec 11, 2024
* fix: Update card-io library to support 16KB page size

This library was manually generated by Outsystems, because card-io library is not maintained anymore

References:
- https://github.com/OS-pedrogustavobilro/card.io-Android-source/tree/fix/RMET-3602/support-16KB-page-size
- https://github.com/OS-pedrogustavobilro/card.io-dmz/tree/fix/RMET-3602/android15-16kb-page-size
- opencv/opencv#26057
- opencv/ci-gha-workflow#183
- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: Update CHANGELOG.md

References:
- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Reduce file of .aar by compiling only specific opencv modules

It's still larger than before, mostly due to x86 and x86_64 architectures. But these are barely used these days. Might also be due to open CV library being larger overall.

References:
- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* fix: Update card.io aar file

References:
- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment

* chore: fix CHANGELOG.md

References:
- https://outsystemsrd.atlassian.net/browse/RMET-3602
- https://outsystemsrd.atlassian.net/wiki/spaces/RDME/pages/4426137659/iOS+18+Android+15+Assessment
@asmorkalov asmorkalov changed the title Switch to Android Build tools 34 and NDK 28b1. Switch to Android Build tools 34 and NDK 26d. Dec 30, 2024
@asmorkalov asmorkalov merged commit e714f34 into main Dec 31, 2024
@asmorkalov asmorkalov added the 5.x-port-needed Should be ported to 5.x after 4.x merge label Dec 31, 2024
asmorkalov added a commit to opencv/opencv that referenced this pull request Dec 31, 2024
Android builds update #26057

Fixes #26027
Should also address #26542
 
Changes:
- Switched to Android build tools 34, NDK 26d, target API level 34 (required by Google Play).
- Use flexible page size on Android by default to support Android 15+.
- Dummy stub for R and BuildConfig classes for javadoc.
- Java 17 everywhere.
- Strict ndkVersion and ABI list in release package.

Related:
- Docker: opencv-infrastructure/opencv-gha-dockerfile#41
- Pipeline: opencv/ci-gha-workflow#183

Related IPP issue with NDK 27+: #26072

Google documentation for 16kb pages support : https://developer.android.com/guide/practices/page-sizes?hl=en

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
shyama7004 pushed a commit to shyama7004/opencv that referenced this pull request Jan 20, 2025
Android builds update opencv#26057

Fixes opencv#26027
Should also address opencv#26542
 
Changes:
- Switched to Android build tools 34, NDK 26d, target API level 34 (required by Google Play).
- Use flexible page size on Android by default to support Android 15+.
- Dummy stub for R and BuildConfig classes for javadoc.
- Java 17 everywhere.
- Strict ndkVersion and ABI list in release package.

Related:
- Docker: opencv-infrastructure/opencv-gha-dockerfile#41
- Pipeline: opencv/ci-gha-workflow#183

Related IPP issue with NDK 27+: opencv#26072

Google documentation for 16kb pages support : https://developer.android.com/guide/practices/page-sizes?hl=en

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
@mshabunin mshabunin deleted the as/android_34 branch January 23, 2025 11:08
@asmorkalov asmorkalov removed the 5.x-port-needed Should be ported to 5.x after 4.x merge label Feb 3, 2025
@asmorkalov
Copy link
Copy Markdown
Contributor Author

Port is done in #219

NanQin555 pushed a commit to NanQin555/opencv that referenced this pull request Feb 24, 2025
Android builds update opencv#26057

Fixes opencv#26027
Should also address opencv#26542
 
Changes:
- Switched to Android build tools 34, NDK 26d, target API level 34 (required by Google Play).
- Use flexible page size on Android by default to support Android 15+.
- Dummy stub for R and BuildConfig classes for javadoc.
- Java 17 everywhere.
- Strict ndkVersion and ABI list in release package.

Related:
- Docker: opencv-infrastructure/opencv-gha-dockerfile#41
- Pipeline: opencv/ci-gha-workflow#183

Related IPP issue with NDK 27+: opencv#26072

Google documentation for 16kb pages support : https://developer.android.com/guide/practices/page-sizes?hl=en

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
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

Successfully merging this pull request may close these issues.

2 participants