Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

:app:transformDexArchiveWithDexMerger IllegalStateException using AS 3.0 beta6

I've started getting following error after updating to AS 3.0 beta 6. Has anyone else come across this? I'm only seeing this error when I try to build/run from AS.....no issue if I run gradle on command line.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerFor<BuildVariantName>Debug'.
> com.android.build.api.transform.TransformException: java.lang.IllegalStateException
like image 600
John O'Reilly Avatar asked Jan 29 '23 12:01

John O'Reilly


1 Answers

Thanks to @Nabin in the comments we found out that enabling Instant Run fix that issue.

Unfortunately - other than the original poster - we had the same issue on the command line. Which means our CI doesn't run.

We found out that we can disabling the incremental dexing by setting the flag -Pandroid.useDexArchive=false. See here for more infos:

A new incremental dexing pipeline has been implemented. Now the Gradle plugin dex only the class files that have changed. It is enabled by default, but you can disable it by doing one of the following:

Passing -Pandroid.useDexArchive=false when running builds from command line e.g. ./gradlew :app:assembleDebug -Pandroid.useDexArchive=false.

Adding android.useDexArchive=false to the gradle.properties file in your root project.

Luckily we don't need incremental dexing on our CI.

Unfourtnaly it doesn't help us in Android Studio with disabled Instant Run!

like image 155
StefMa Avatar answered Feb 06 '23 14:02

StefMa