0

I've been trying for days now to get this build to complete correctly... It keeps failing with the following error:

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: 
org.gradle.process.internal.ExecException: 
Process 'command 'C:\Program Files\Java\jdk1.8.0_31\bin\java.exe'' finished with non-zero exit value 2

My gradle file that I believe is failing is as follows:

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile project(':vitamio')
  compile project(':zeropush-sdk')
  debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3'
  releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3'
  compile files('libs/YouTubeAndroidPlayerApi.jar')
  compile 'com.android.support:appcompat-v7:22.2.1'
  compile 'com.android.support:design:22.2.1'
  compile 'com.android.support:support-v4:22.2.1'
  compile 'com.google.android.gms:play-services-analytics:7.5.0'
  compile 'com.squareup.retrofit:retrofit:1.7.0'
  compile 'com.squareup:otto:1.3.6'
  compile 'com.squareup.picasso:picasso:2.4.0'
  compile 'com.ns-developer:tagcloudview:0.1.0'
  compile 'com.android.support:recyclerview-v7:22.2.1'
  compile 'com.android.support:mediarouter-v7:22.1.1'
  //    compile 'com.google.android.exoplayer:exoplayer:r1.4.1'
  compile('com.crashlytics.sdk.android:crashlytics:2.5.3@aar') {
      transitive = true;
  }
  androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.4.1'
}

I think it has to do with adding a dependency twice...but I can't see any that are being added twice.

Does anyone see something I shouldn't be importing or know what this error could mean?

zeropush-sdk is also built in this project and its gradle file is this:

dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   compile 'com.loopj.android:android-async-http:1.4.6'
   compile 'com.google.android.gms:play-services:7.5.0'
}
DranoMax
  • 474
  • 4
  • 18

1 Answers1

0

The first thing I would attempt to do is only use the api's of Google Play Services that you actually need as opposed to 'com.google.android.gms:play-services:7.5.0', see Google Play Services setup. It is recommends that you only add the the Google Play services that you are using, as opposed to all of them. This will most dramatically reduce the size of your app and elevate the need for dexing.

As for the actual duplicates, you have

compile 'com.google.android.gms:play-services:7.5.0' compile 'com.google.android.gms:play-services-analytics:7.5.0'

remove the following for a quick test

compile 'com.google.android.gms:play-services:7.5.0'

and then add any other specific Google Play Services api's that you need.

There is also the possibility of other duplicates from your libs folder, but I can't say since it's not listed.

Peter Birdsall
  • 3,159
  • 5
  • 31
  • 48