1

I'm having trouble while compiling my project and getting the following Exception please help me out.

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_65\bin\java.exe'' finished with non-zero exit value 1

my app.build gradle file code is:

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "my.appid"
    minSdkVersion 15
    targetSdkVersion 24
    versionCode 2
    versionName "1.0.1"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE-FIREBASE.txt'
    exclude 'META-INF/NOTICE'
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:palette-v7:24.1.1'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.firebase:firebase-ads:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.android.support:multidex:1.0.0'

}
apply plugin: 'com.google.gms.google-services'

And check my project.gradle file code is:

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
    classpath 'com.google.gms:google-services:3.0.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Atif Umar
  • 83
  • 1
  • 2
  • 8

1 Answers1

0

It looks like you've found a solution to your issue via multidex, but I wanted to point out something about your build settings. In your build.gradle you list these:

compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.firebase:firebase-ads:9.4.0'
compile 'com.google.android.gms:play-services-ads:9.4.0'

You can take out play-services-ads, as it's included with both firebase-ads and play-services. Also, If the only part of Play services you're using is AdMob, you can actually take out play-services, too.

We recently put up a blog post explaining a bit about what's in each of these artifacts, as well:

Hopefully that helps sort things out a little bit!

RedBrogdon
  • 5,113
  • 2
  • 24
  • 31