diff --git a/examples/app/build.gradle b/examples/app/build.gradle index 31302cb..5ce9f6c 100644 --- a/examples/app/build.gradle +++ b/examples/app/build.gradle @@ -38,10 +38,14 @@ android { apply plugin: 'org.mozilla.rust-android-gradle.rust-android' -tasks.whenTaskAdded { task -> - if ((task.name == 'javaPreCompileDebug' || task.name == 'javaPreCompileRelease')) { - task.dependsOn 'cargoBuild' - } +task fixNotCopyingRustJniLibs(type: Delete) { + delete layout.buildDirectory.dir("intermediates/merged_jni_libs") +} + +project.afterEvaluate { + tasks.getByName("mergeDebugJniLibFolders").dependsOn("cargoBuild") + tasks.getByName("mergeReleaseJniLibFolders").dependsOn("cargoBuild") + tasks.getByName("cargoBuild").dependsOn("fixNotCopyingRustJniLibs") } cargo { diff --git a/examples/wallet/build.gradle b/examples/wallet/build.gradle index c56845b..566fc27 100644 --- a/examples/wallet/build.gradle +++ b/examples/wallet/build.gradle @@ -38,10 +38,14 @@ android { apply plugin: 'org.mozilla.rust-android-gradle.rust-android' -tasks.whenTaskAdded { task -> - if ((task.name == 'javaPreCompileDebug' || task.name == 'javaPreCompileRelease')) { - task.dependsOn 'cargoBuild' - } +task fixNotCopyingRustJniLibs(type: Delete) { + delete layout.buildDirectory.dir("intermediates/merged_jni_libs") +} + +project.afterEvaluate { + tasks.getByName("mergeDebugJniLibFolders").dependsOn("cargoBuild") + tasks.getByName("mergeReleaseJniLibFolders").dependsOn("cargoBuild") + tasks.getByName("cargoBuild").dependsOn("fixNotCopyingRustJniLibs") } cargo {