gpt4 book ai didi

android - React Native,任务 ':app:mergeDexDebug' 执行失败

转载 作者:行者123 更新时间:2023-12-04 12:36:09 24 4
gpt4 key购买 nike

我正在尝试在物理设备中运行我的应用程序,但出现该错误。我试图用 cd android 清理 gradlew和 ./gradlew clean .我也尝试清理缓存,但它给出了那个错误。我只是安装了 react 导航和堆栈导航,之后我得到了那个错误我也尝试重新安装导航包但仍然得到同样的错误。任何人都可以帮助我吗?错误和 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"
},

最佳答案

根据文档
When your app and the libraries it references exceed 65,536 methods, you encounter a build error that indicates your app has reached the limit of the Android build architecture
您可以尝试启用 multiDex解决这个问题
在你的 android/app/build.gradle

defaultConfig {
/** ... */
multiDexEnabled true
}
作为预防措施,清理您的构建和物理设备中任何已安装的实例

关于android - React Native,任务 ':app:mergeDexDebug' 执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64675566/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com