api - React-native 应用程序:构建失败并出现异常错误
问题描述
我正在制作一个应用程序,但突然我的应用程序停止工作。所有应用程序之前都可以正常运行。但突然之间,这种情况发生了。现在,当我尝试运行应用程序时,它给了我错误:
" > Task :app:transformClassesWithDexBuilderForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\zains\.gradle\caches\transforms-1\files-1.1\firebase-analytics-impl-11.8.0.aar\5f122df5deada8f908914f5bd04e05ad\jars\classes.jar "
这是屏幕截图:
任何人都可以帮我解决这个问题吗?
解决方案
这样做:
在主项目文件夹中,在终端类型中
cd android
然后输入这个
./gradlew clean
或者试试这个,在你的项目文件夹中运行这个代码
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
在那之后
cd android && ./gradlew clean && cd .. && react-native run-android
然后再次构建您的应用程序
推荐阅读
- python - 如何处理缺失值
- java - 将选项列表收集到包含当前选项的列表中
- google-cloud-platform - 在我们的谷歌云 Pub/Sub 发布者权限之外提供 Gmail-API
- scala - 在 Scala 中验证 IP 地址
- shell - 如何在所有 . 和/在 10.0.1.0/24 中?
- firebase - RNFirebase v6 推送通知不会同时出现在 iOS 和 Android 中
- python - ListView 中的 Django 表单,表单的 POST 错误
- ios - 调整 UIBarButtonItems 的大小
- slurm - 如何根据作业 ID 查找用于 slurm 作业的命令?
- node.js - 有没有办法将 OracleDB 与 Node 10.15 一起使用?