question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate .so files error on building on a fresh project

See original GitHub issue

v0.1.88 works after adding the following in app/build.gradle in a fresh RN project:

packagingOptions {
        pickFirst "lib/**/*.so"
    }

I think duplicate .so files should be excluded in build.gradle of the library so there are no duplicate errors such as these:

* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'lib/arm64-v8a/libturbomodulejsijni.so' from inputs:
      - /home/ammarahm-ed/Repos/tryskia/node_modules/@shopify/react-native-skia/android/build/intermediates/library_jni/debug/jni
      - /home/ammarahm-ed/.gradle/caches/transforms-3/7403ebe5571a2ce5a6a5fc9876af4814/transformed/jetified-react-native-0.66.4/jni
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
ammarahm-edcommented, Jan 27, 2022

Hey @chrfalch So I tested again and the issue is still there. I have however gathered the list of .so files that are causing a duplication error:

 packagingOptions {
        pickFirst "lib/**/libfbjni.so"
        pickFirst "lib/**/libreact_nativemodule_core.so"
        pickFirst "lib/**/libturbomodulejsijni.so"
        pickFirst "lib/**/libjsi.so"
    }

After adding this, everything seems to build correctly.

0reactions
wcandilloncommented, May 7, 2022

These should be fixed now. Feel free to reopen if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix the libgnustl_shared.so file duplicated which in third ...
one of my modules has the same libgnustl_shared.so file , when i add the ReactAndroid to my project , i get this error...
Read more >
Duplicate Errors in Linking | Apple Developer Forums
I created a new non-document CoreData app using XCode template. Added in two persistent classes, FileServers and Server, from another (previously working) ...
Read more >
Building Projects — Emscripten 3.1.26-git (dev) documentation
The compilation error multiply defined symbol indicates that the project has linked a particular static library multiple times. The project will need to...
Read more >
Android Build Error Analyzer (Duplicate Class Error be gone)
Try disabling each third party asset and make a new build. Do that until the error is gone. Once you know which one...
Read more >
How to: Create a C++ Project from Existing Code | Microsoft ...
Check to set the wizard to copy existing code files from their original directories (that are specified in the list box below this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found