首页 > 解决方案 > 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 "

这是屏幕截图:

在此处输入图像描述

在此处输入图像描述

任何人都可以帮我解决这个问题吗?

标签: apireact-nativebuildreact-reduxfetch

解决方案


这样做:

在主项目文件夹中,在终端类型中

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

然后再次构建您的应用程序


推荐阅读