Android gradle plugin multidex ZipException [duplicate]
Asked Answered
R

2

9

I'm trying to use the new multidex option but I get the following error:

Execution failed for task ':packageAll[Variant]TestClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: android/support/multidex/BuildConfig.class

I've been able to discover the issue only happens when running the connectedAndroidTests task, and not when simply building the project (build).

Refinement answered 20/11, 2014 at 6:34 Comment(0)
S
5

There's an issue for this, and it's resolved in multi-dex library 1.0.1, see: Duplicate BuildConfig classes when using multidex test support

Try:

compile 'com.android.support:multidex:1.0.1'
androidTestCompile 'com.android.support:multidex-instrumentation:1.0.1'
Shiner answered 15/1, 2015 at 9:7 Comment(1)
I switched to 1.0.1 and still the same issue.Aegisthus
M
0

The last section of this specify that

Note: Use of multidex for creating a test APK requires extra setup.

This is probably the reason.

Millwater answered 24/11, 2014 at 7:48 Comment(2)
I am using the MultiDexTestRunner. This error happens during the execution of the packaging task which the connected[Variant]Test task depends on.Refinement
Did you find a solution for your problem ? I have the same ==> https://mcmap.net/q/1318879/-robotium-android-studioCorselet

© 2022 - 2024 — McMap. All rights reserved.