尝试构建离子Android应用时出现Dex错误

时间:2018-03-05 04:39:16

标签: android cordova ionic-framework gradle

我正在尝试为Android构建一个离子应用程序,但是当我运行

ionic cordova run android

我得到了

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: java.lang.IllegalStateException: Dex archives: setting .DEX extension only for .CLASS files

尝试运行./gradlew clean让我

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().

1 个答案:

答案 0 :(得分:9)

我有同样的问题,但已经解决了。感谢@notlose在此链接https://github.com/oney/react-native-gcm-android/issues/32

提供的信息

<强>解决方案:
只需删除 / android / android / app 中的'build'文件夹 用再次建造 反应原生的 react-native run-android ' '离子cordova运行android '为离子

相关问题