ammarahm-ed / react-native-jsi-template

Template library and blog that explain how JSI modules are built from scratch in React Native
https://blog.notesnook.com/getting-started-react-native-jsi/
MIT License
163 stars 24 forks source link

More than one file was found with OS independent path 'lib/x86/libreactnativeutilsjni.so' #4

Closed blowback closed 3 years ago

blowback commented 3 years ago

Trying to build the example app for android, I get the above build failure. A link is mentioned https://developer.android.com/studio/preview/features#automatic_packaging_of_prebuilt_dependencies_used_by_cmake but actually see here https://developer.android.com/studio/releases/gradle-plugin#cmake-imported-targets - none of this appears to be relevant tho.

ammarahm-ed commented 3 years ago

Use this in app/build.gradle in example app.

android {
.....
packagingOptions {
    pickFirst '**/*.so'
}

....
}
blowback commented 3 years ago

That sorted it! Many thanks.

ammarahm-ed commented 3 years ago

@blowback I have fixed this on master. If you pull again, you don't need to make that change in example app.

blowback commented 3 years ago

FYI fix on master didn't work for me, I still had to make the above change to the example's app/build.gradle