diff --git a/.changeset/grumpy-jars-see.md b/.changeset/grumpy-jars-see.md new file mode 100644 index 00000000..2202a157 --- /dev/null +++ b/.changeset/grumpy-jars-see.md @@ -0,0 +1,5 @@ +--- +'brownfield': patch +--- + +fix: call copyStrippedSoLibs once after the loop to avoid redundant SO file copying diff --git a/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/JNILibsProcessor.kt b/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/JNILibsProcessor.kt index 36bf47d0..f465126a 100644 --- a/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/JNILibsProcessor.kt +++ b/gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/JNILibsProcessor.kt @@ -53,9 +53,7 @@ class JNILibsProcessor : BaseProject() { for (archiveLibrary in aarLibraries) { val jniDir = archiveLibrary.getJniDir() processNestedLibs(jniDir.listFiles(), existingJNILibs) - if (projectExt.useStrippedSoFiles) { - copyStrippedSoLibs(variant, existingJNILibs) - } else { + if (!projectExt.useStrippedSoFiles) { if (jniDir.exists()) { val filteredSourceSets = androidExtension.sourceSets.filter { sourceSet -> sourceSet.name == variant.name } @@ -67,6 +65,9 @@ class JNILibsProcessor : BaseProject() { } } } + if (projectExt.useStrippedSoFiles) { + copyStrippedSoLibs(variant, existingJNILibs) + } } } }