[英]When I install react-native-fbsdk I get: Execution failed for task ':app:mergeDexDebug'
[英]React Native, Execution failed for task ':app:mergeDexDebug'
我正在尝试在物理设备上运行我的应用程序,但出现该错误。 我试图用cd android
和./gradlew clean
清理 gradlew 。 我也尝试清理缓存,但它给出了那个错误。 我只是安装了反应导航和堆栈导航,然后我收到了那个错误我也尝试重新安装导航包,但仍然遇到同样的错误。 有人可以帮我吗? 错误和 package.json 在下面
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
包.json
"dependencies": {
"@react-native-community/google-signin": "^5.0.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/native": "^5.8.4",
"@react-navigation/stack": "^5.12.1",
"is_js": "^0.9.0",
"react": "16.13.1",
"react-native": "^0.63.1",
"react-native-fbsdk": "^2.0.0",
"react-native-flash-message": "^0.1.16",
"react-native-gesture-handler": "^1.8.0",
"react-native-localization": "^2.1.6",
"react-native-reanimated": "^1.13.1",
"react-native-safe-area-context": "^3.1.8",
"react-native-screens": "^2.12.0",
"react-native-vector-icons": "^7.1.0",
"react-native-webview": "^10.10.0"
},
根据文档
当您的应用及其引用的库超过 65,536 个方法时,您会遇到构建错误,表明您的应用已达到 Android 构建架构的限制
您可以尝试启用multiDex
来解决此问题
在你的 android/app/build.gradle
defaultConfig {
/** ... */
multiDexEnabled true
}
作为预防措施,清理您的构建和物理设备中任何已安装的实例
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.