React-native应用程序:构建失败,出现异常错误

时间:2019-04-29 05:15:26

标签: api react-native build react-redux fetch

我正在制作一个应用程序,但是突然我的应用程序停止工作。 所有应用之前都运行正常。但是现在突然发生了。 现在,当我尝试运行应用程序时,它给了我错误:

" > 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 "

这是屏幕截图:

enter image description here

enter image description here

有人可以帮我吗

1 个答案:

答案 0 :(得分:2)

只需这样做:

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

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

然后再次构建您的应用