You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Build Failure: Duplicate Resources Error During AAR Packaging with React Native Libraries #125
I'm experiencing a build failure when trying to create an AAR file using the React Native Brownfield plugin. The build process fails with a "Duplicate resources" error during the packageDebugResources task.
Error Details:
Execution failed for task ':rnbrownfieldLibrary:packageDebugResources'.
// Pick first libworklets.so to resolve conflicts between
// react-native-reanimated and react-native-worklets
pickFirsts += "lib/armeabi-v7a/libworklets.so"
pickFirsts += "lib/arm64-v8a/libworklets.so"
pickFirsts += "lib/x86/libworklets.so"
pickFirsts += "lib/x86_64/libworklets.so"
}
}
in your build.gradle.kts add inside android
then add below code as your library name publishing inside
afterEvaluate {
listOf("mergeReleaseJniLibFolders", "mergeDebugJniLibFolders").forEach { taskName ->
tasks.named(taskName) {
doFirst {
// Remove duplicate libworklets.so from react-native-worklets to avoid conflicts
// with react-native-reanimated which also provides the same library
fileTree("$buildDir/intermediates/exploded-aar/Loyalty_Cobrand/react-native-worklets") {
include("/jni//libworklets.so")
}.forEach { file ->
println("Removing duplicate libworklets.so: ${file.path}")
file.delete()
}
}
}
}
}
Thanks @marcinszalski-callstack . @hidaeraldo , we couldn't reproduce the issue on our end and since we don't have any reports of it in the newest version, I'll close this one. In case something new would pop out, please let us know.
Activity
hurali97 commentedon Aug 21, 2025
Thanks for raising this. I will look into this over a few days 👍
VigneshPandianB25 commentedon Sep 20, 2025
packaging {
jniLibs {
if (!hermesEnabled) {
excludes += "lib/x86/libjsctooling.so"
excludes += "lib/x86_64/libjsctooling.so"
excludes += "lib/armeabi-v7a/libjsctooling.so"
excludes += "lib/arm64-v8a/libjsctooling.so"
}
in your build.gradle.kts add inside android
then add below code as your library name publishing inside
afterEvaluate {
listOf("mergeReleaseJniLibFolders", "mergeDebugJniLibFolders").forEach { taskName ->
tasks.named(taskName) {
doFirst {
// Remove duplicate libworklets.so from react-native-worklets to avoid conflicts
// with react-native-reanimated which also provides the same library
fileTree("$buildDir/intermediates/exploded-aar/Loyalty_Cobrand/react-native-worklets") {
include("/jni//libworklets.so")
}.forEach { file ->
println("Removing duplicate libworklets.so: ${file.path}")
file.delete()
}
}
}
}
}
marcinszalski-callstack commentedon Apr 2, 2026
@hidaeraldo
would it help if you'd add the following snippet into
.../apps/RNApp/android/BrownfieldLib/build.gradle.kts:marcin-szalski-ridelink commentedon May 14, 2026
no updates here for more than 5 weeks already, @artus9033
artus9033 commentedon May 14, 2026
Thanks @marcinszalski-callstack . @hidaeraldo , we couldn't reproduce the issue on our end and since we don't have any reports of it in the newest version, I'll close this one. In case something new would pop out, please let us know.
fix(bgp): merge res/values of embedded libraries instead of overwriting
fix(bgp): merge res/values of embedded libraries instead of overwriting
fix(bgp): merge res/values of embedded libraries instead of overwriting
fix(bgp): merge res/values of embedded libraries instead of overwriting
fix(bgp): merge res/values of embedded libraries instead of overwriting
fix(bgp): merge res/values of embedded libraries instead of overwriti…