diff --git a/android/core/build.gradle b/android/core/build.gradle index 10fecef0..87d3ee89 100644 --- a/android/core/build.gradle +++ b/android/core/build.gradle @@ -92,4 +92,12 @@ android.libraryVariants.all { variant -> // idea.module.generatedSourceDirs += file("${buildDir}/generated/source/uniffi/${variant.name}/java/uniffi") sourceSet.java.srcDir 'src/main/java' +} + +// Fixes a bug(?) with certain AGP versions that results in UnsatisfiedLinkErrors in some conditions. +// See https://github.com/mozilla/rust-android-gradle/issues/118#issuecomment-1778332125 + +tasks.matching { it.name.matches(/merge.*JniLibFolders/) }.configureEach { + it.inputs.dir(new File(buildDir, "rustJniLibs/android")) + it.dependsOn("cargoBuild") } \ No newline at end of file