任务':app:mergeDebugNativeLibs'的执行失败。在本地反应

时间:2020-09-25 18:19:31

标签: android react-native gradle react-native-pdf

我在我的项目中安装了react-native-pdf,当我使用“ npx react-native run-android”运行时,失败并显示以下错误

* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > More than one file was found with OS independent path 'lib/x86/libc++_shared.so'

任何人都可以帮助我的人使用包react-native-pdf

ive

3 个答案:

答案 0 :(得分:3)

我遇到了同样的问题,并通过将以下内容添加到android / app / build.gradle

来解决了该问题
android {

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

/** rest of your code here **/

}

答案 1 :(得分:1)

在Android Studio android中打开项目并清理项目 CUBIN: CUDA_ERROR_NO_BINARY_FOR_GPU: no kernel image is available for execution on the device

答案 2 :(得分:-1)

我在“android/app/build.gradle”中将 minSdkVersion 更改为 21。

defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.custom_epub_view"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }