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

Snicolas
  • 37,840
  • 15
  • 114
  • 173
dcow
  • 7,765
  • 3
  • 45
  • 65

2 Answers2

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'
Sugre
  • 851
  • 2
  • 9
  • 19
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.

dcow
  • 7,765
  • 3
  • 45
  • 65
JCzz
  • 17
  • 3
  • I am using the `MultiDexTestRunner`. This error happens during the execution of the packaging task which the `connected[Variant]Test` task depends on. – dcow Nov 24 '14 at 22:13
  • Did you find a solution for your problem ? I have the same ==> http://stackoverflow.com/questions/27277285/robotium-android-studio – mrroboaat Dec 04 '14 at 09:52