LAB
LAB

Reputation: 83

Dex error when trying to build ionic Android app

I'm trying to build an ionic app for Android but when I run

ionic cordova run android

I get

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

Trying to run ./gradlew clean gets me

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().

Upvotes: 6

Views: 2302

Answers (1)

OPMat
OPMat

Reputation: 473

I had the same issue but it was resolved. Thanks to information from @notlose at this link https://github.com/oney/react-native-gcm-android/issues/32

Solution:
just remove both 'build' folder in /android and /android/app and build again with
'react-native run-android' for react-native
'ionic cordova run android' for ionic

Upvotes: 10

Related Questions