Task :app:transformNativeLibsWithMergeJniLibsForDebug FAILED

后端 未结 7 853
悲&欢浪女
悲&欢浪女 2020-12-31 00:08

I am working with react native and every time I build a new project it seems to work on my device , but whenever I try to restart it It is giving me 1 or more errors

<
相关标签:
7条回答
  • 2020-12-31 00:23

    go to android/app/build.grad

    android { ... + packagingOptions { + pickFirst '**/libjsc.so' + pickFirst 'lib/x86/libc++_shared.so' + pickFirst 'lib/x86_64/libjsc.so' + pickFirst 'lib/arm64-v8a/libjsc.so' + pickFirst 'lib/arm64-v8a/libc++_shared.so' + pickFirst 'lib/x86_64/libc++_shared.so' + pickFirst 'lib/armeabi-v7a/libc++_shared.so'
    + } }

    0 讨论(0)
  • 2020-12-31 00:26

    Running the cleaning task solved the problem for me. In your project's android dir, run gradle wrapper with 'clean'

    cd android && ./gradlew clean 
    

    Then you can go back to project dir and try running again.

    cd .. && react-native run-android
    
    0 讨论(0)
  • 2020-12-31 00:26

    go to android/app/build.gradle add the following under android

    android {
        ...
    +   packagingOptions {
    +       pickFirst '**/libjsc.so'
    +       pickFirst 'lib/x86/libc++_shared.so'
    +       pickFirst 'lib/x86_64/libjsc.so'
    +       pickFirst 'lib/arm64-v8a/libjsc.so'
    +       pickFirst 'lib/arm64-v8a/libc++_shared.so'
    +       pickFirst 'lib/x86_64/libc++_shared.so'
    +       pickFirst 'lib/armeabi-v7a/libc++_shared.so'  
    +   }
    }
    

    Running the cleaning task solved the problem for me. In your project's android dir, run gradle wrapper with 'clean'

    cd android && ./gradlew clean

    Then you can go back to project dir and try running again.

    cd .. && react-native run-android

    0 讨论(0)
  • 2020-12-31 00:41

    Go to android/app/build.gradle and add the following thing under android:

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

    Then run it again. If your using react native i suggest you to close npm console and run it again.

    0 讨论(0)
  • 2020-12-31 00:42

    in my case in react-native app this error was beacause of rn-fetch-blob v0.12.0, and it makes release apk crash too
    i do this:

    npm uninstall rn-fetch-blob
    npm i rn-fetch-blob@0.11.2
    cd android && gradlew clean
    cd..
    react-native run-android
    

    hope this help somebody <3

    0 讨论(0)
  • 2020-12-31 00:43

    AAR libraries were not linking to the Main application from Bridge Project.

    Solution:

    implementation files(‘libs/sdk-5.0.0.aar’)
    

    Instead of

    implementation(name:'sdk-5.0.0', ext:'aar')
    

    I faced another issue related to AAR file import into the android project. https://stackoverflow.com/a/58602329/3197778

    0 讨论(0)
提交回复
热议问题