Skip to content

Commit

Permalink
fix: Gradle assemble release and architecture list
Browse files Browse the repository at this point in the history
Fix missing copy of native libs when assembling the APK
(mozilla/rust-android-gradle#85).

Restrict supported architectures to aarch64 and x86_64.
  • Loading branch information
LeanderBB committed May 19, 2023
1 parent 6984c6e commit b42b5fd
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions you-have-mail-android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "dev.lbeernaert.youhavemail"
minSdk 29
targetSdk 33
versionCode 18
versionName "0.7.0"
versionCode 19
versionName "0.7.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -47,6 +47,12 @@ android {
}
}
ndkVersion "25.2.9519653"

defaultConfig {
ndk {
abiFilters 'arm64-v8a', 'x86_64'
}
}
}

dependencies {
Expand Down Expand Up @@ -85,13 +91,14 @@ cargo {
}*/
}

afterEvaluate {

tasks.whenTaskAdded { task ->
if ((task.name == 'javaPreCompileDebug' || task.name == 'javaPreCompileRelease')) {
task.dependsOn 'cargoBuild'
}
tasks.whenTaskAdded { task ->
// Require cargo to be run before copying native libraries.
if ((task.name == 'mergeDebugJniLibFolders' || task.name == 'mergeReleaseJniLibFolders')) {
task.dependsOn 'cargoBuild'
}
}

afterEvaluate {

// The `cargoBuild` task isn't available until after evaluation.
android.applicationVariants.all { variant ->
Expand Down

0 comments on commit b42b5fd

Please sign in to comment.