Fix native library stripping by using matching NDK version for AGP 8.6.1#66
Conversation
- Set NDK version to 27.0.12077973 (default for AGP 8.6.1) - Updated CI workflow to install correct NDK version - Removed old hardcoded NDK version (25.1.8937393) Fixes nain-F49FF806#11
|
The build failure is not related to the changes in this PR - it's a temporary Maven Central issue: This happens sometimes when Maven Central rate-limits GitHub Actions IPs or has temporary availability issues. A re-run of the workflow should fix it. |
|
@inventory69 Yes. Let's wait for the rate limit window to pass. Will run this again in a couple of hours. |
|
Thanks for the PR, @inventory69. Nice work! A quick question on the NDK version though: You mentioned that |
|
Also want to say: I really like the way you harmonized the version across the build configs (both) and environment variables. It's a much more robust setup. This level of consistency is exactly what we need. That said, I wonder if we could get away with simply using a consistent NDK version, rather than matching the AGP with a 'magic' NDK number. While keeping your changes, would using the default |
|
@nain-F49FF806 Thanks for the feedback, I really appreciate it! Even though I made a mistake and assumed the version 27.0.12077973 is the default one, which is obviously not.. Now we have 2 options, we can stick to the newer ndk which works well. Using a version number like 26.1 or 27.0 would not work because AGP doesn't accept it unfortunately. |
nain-F49FF806
left a comment
There was a problem hiding this comment.
Thanks for confirming it works with the default NDK version. This is very promising.
To keep this easy to maintain across modules, I've suggested centralising the versioning.
Let's get those minor changes in, and we are good to go!
- Rename property to PROJECT_NDK_VERSION for clarity - Change version to 26.1.10909125 (official AGP 8.6 default) - Use gradleProperty() in build scripts for single source of truth - Update CI workflow to match new NDK version Addresses review feedback from @nain-F49FF806
|
@nain-F49FF806 Hey, i've implemented all the requested changes in Commit 7635762. |
The ndkVersion property expects a String, not a Provider<String>. Calling .get() resolves the provider to its actual value.
|
lgtm! |
|
Thank you for your contribution @inventory69 ! |
|
@nain-F49FF806 You're welcome! I am glad that I could help, as I really like your project! |
Fixes #11
The issue was that we're using AGP 8.6.1 but didn't specify which NDK version to use. This caused inconsistent behavior where debug symbols weren't being stripped properly, making the APKs way bigger than necessary.
Changes
According to the AGP 8.6 release notes, AGP automatically strips debug symbols when using its tested NDK version. By matching them up, we should get properly stripped libraries without the bloat.
Tested locally with `./gradlew build --dry-run` - no errors.