【问题标题】:React-native app: Build failed with an exception errorReact-native 应用程序:构建失败并出现异常错误
【发布时间】:2019-04-29 05:15:26
【问题描述】:

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

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

这里是截图:

谁能帮我解决这个问题

【问题讨论】:

  • 2019年你为什么用cmd,还有那么多其他的终端。使用 Gitbash
  • 我用过Gitbash终端,但我喜欢cmd,它真的很纯粹,很棒

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


【解决方案1】:

只要这样做:

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

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

然后再次构建您的应用

【讨论】:

  • 我的文件会被删除吗?
  • 什么都不会被删除,它只是一个杀死旧版本并重新运行项目的过程
  • 检查我添加的有问题的屏幕截图,它没有运行这个“cd android && ./gradlew clean”
  • 在 android 文件夹中执行 ls 并检查 gradlew 文件的名称。如果它现在运行gradlew clean@ZainShabir
猜你喜欢
  • 1970-01-01
  • 2020-11-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-12
  • 2018-12-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多