Skip to content

Android builds update#26057

Merged
asmorkalov merged 12 commits intoopencv:4.xfrom
asmorkalov:as/android_16k_pages
Dec 31, 2024
Merged

Android builds update#26057
asmorkalov merged 12 commits intoopencv:4.xfrom
asmorkalov:as/android_16k_pages

Conversation

@asmorkalov
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov commented Aug 22, 2024

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:

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

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • 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

@asmorkalov asmorkalov added this to the 4.11.0 milestone Aug 22, 2024
@asmorkalov asmorkalov changed the title WIP: Use flexible page size on Android by default to support Android 15+ Use flexible page size on Android by default to support Android 15+ Aug 22, 2024
@asmorkalov asmorkalov changed the title Use flexible page size on Android by default to support Android 15+ Android builds update Aug 26, 2024
@asmorkalov asmorkalov force-pushed the as/android_16k_pages branch from 8d8d347 to 76f32aa Compare December 9, 2024 09:00
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 force-pushed the as/android_16k_pages branch 2 times, most recently from 035fbe5 to 55d755f Compare December 24, 2024 08:51
@asmorkalov asmorkalov force-pushed the as/android_16k_pages branch 2 times, most recently from 2d9994e to e07e0c6 Compare December 30, 2024 11:27
@asmorkalov asmorkalov force-pushed the as/android_16k_pages branch 2 times, most recently from 4b59cde to 25efb1c Compare December 30, 2024 17:35

# For 16k pages support with NDK prior 27
# Details: https://developer.android.com/guide/practices/page-sizes?hl=en
if(ANDROID AND ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES AND (ANDROID_ABI STREQUAL arm64-v8a OR ANDROID_ABI STREQUAL x86_64))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES

OPENCV_ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES to avoid possible conflicts

@asmorkalov asmorkalov merged commit c803aa2 into opencv:4.x Dec 31, 2024
@asmorkalov asmorkalov mentioned this pull request Jan 15, 2025
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
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android 15: UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH

4 participants