java.lang.IllegalStateException: Dex archives: setting .DEX extension only for .CLASS files

m.myalkin picture m.myalkin · Dec 13, 2017 · Viewed 37.3k times · Source

I build the project at gitlab ci

./gradlew assembleDebug --stacktrace

and sometimes it throws an error:

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

At my local pc it works correctly.

kotlin version is 1.2

multidex is enabled

What is the reason of this error?

Answer

mixel picture mixel · Jan 12, 2018

./gradlew clean fixed the same error for me.