JNI libraries missing in AAR file on first build
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- android, rust
- Domain
- build-system, mobile
Research direction
Start with the reproduction in samples/library, its build.gradle configuration, and the assembleDebug task. Build once from a clean state, inspect build/outputs/aar/library-debug.aar, then build again for comparison. Done means the first assembleDebug build includes the JNI libraries in the AAR.
Written by the indexing model from the issue text.
Description
When I build my library project for the first time after cleaning the build, build/outputs/aar/library-debug.aar does not contain the JNI libraries. Only when building for a second time, the JNI libraries are included.
This can be reproduced with samples/library of this repo:
-
Checkout the repo
git clone git@github.com:mozilla/rust-android-gradle.git cd rust-android-gradle/ -
Copy the gradle wrapper into
samples/librarycd samples/library cp ../../gradlew . cp -Ra ../../gradle . -
Update the gradle wrapper to the latest version
export ANDROID_HOME=~/Library/Android/sdk/ ./gradlew wrapper --gradle-version 6.6.1 -
Make the project use the rust plugin from the repository instead of the locally build one
rm settings.gradle touch settings.gradleIn
build.gradle, change the rust plugin classpath togradle.plugin.org.mozilla.rust-android-gradle:plugin:0.8.3 -
Update the Android gradle plugin to 4.0.1 in
build.gradle -
Build the library
./gradlew assembleDebug -
Look at
build/outputs/aar/library-debug.aarand notice the JNI libraries are not included. -
Build the library again by again invoking
./gradlew assembleDebug. Nowbuild/outputs/aar/library-debug.aarwill contain the JNI libraries.
Is there a workaround for this that I could apply to build.gradle?
- Dominant language
- Kotlin
- Stars
- 1.3k
- Forks
- 95
- Avg merge
- 15m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mozilla/rust-android-gradle
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla/rust-android-gradle#174 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mozilla/rust-android-gradle#166 · 1 comment · 3 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
mozilla/rust-android-gradle#163 · 2 comments · 2 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
mozilla/rust-android-gradle#158 · 7 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
mozilla/rust-android-gradle#152 · 1 comment ·
All issues in mozilla/rust-android-gradle
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Good First Issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ankidroid/Anki-Android#21942 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
libre-tube/LibreTube#8781 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
MetrolistGroup/Metrolist#4396 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100