[英]When I install react-native-fbsdk I get: Execution failed for task ':app:mergeDexDebug'
I get Execution failed for task ':app:mergeDexDebug' when I install react-native-fbsdk 2.0.0 and then run react-native run-android.当我安装 react-native-fbsdk 2.0.0 然后运行 react-native run-android 时,我得到任务 ':app:mergeDexDebug' 的执行失败。
My project with react-native:我的 react-native 项目:
npmPackages:
react: 16.13.1 => 16.13.1
react-native: 0.63.2 => 0.63.2
android/build.gradle:安卓/build.gradle:
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29
}
}
console:安慰:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDexDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
warning: [options] source value 7 is obsolete and will be removed in a future release
add in android/app/build.gradle:在 android/app/build.gradle 中添加:
android {
.
.
.
defaultConfig {
applicationId "com.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
}
.
.
.
}
the line:该行:
multiDexEnabled true
multiDexEnabled 真
Can you try this bt=y adding你可以试试这个 bt=y 添加
In your module level build.gradle file.在您的模块级别 build.gradle 文件中。 Something like this:
像这样的东西:
android {
defaultConfig {
...
minSdkVersion 21
targetSdkVersion 26
multiDexEnabled true
}
...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.