Skip to content Skip to sidebar Skip to footer

Studio : Execution Failed For Task App:transformclasseswithjarmergingfordebug

I got this below error in gradle build Messages .I tried many Stackoverflow post relevant to this issue.But nothing worked for me. Error:Execution failed for task ':app:transfo

Solution 1:

In your Gradle Compile with support:multidex and add also dexOptions

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

useLibrary 'org.apache.http.legacy'

defaultConfig {
   ..............
    minSdkVersion 19
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true


}
dexOptions {
    //incremental = true;
    preDexLibraries = false
    javaMaxHeapSize "4g"
}

packagingOptions {
    exclude 'META-INF/NOTICE.txt'// will not include NOTICE file
    exclude 'META-INF/LICENSE.txt'// will not include LICENSE file
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
 }

 dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile files('libs/gcm.jar')
compile files('libs/glide-3.6.1.jar')
compile files('libs/httpcore-4.3-beta1.jar')
compile files('libs/httpmime-4.3.jar')
compile files('libs/universal-image-loader-1.9.5.jar')
compile 'com.android.volley:volley:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.0'
compile project(':facebook')
compile project(':InstaLibrary')
compile project(':simple-crop-image-lib')
compile files('libs/twitter4j-core-4.0.4.jar')
compile 'com.android.support:multidex:1.0.1'
 }

In Your AndroidManifest.xml add this lines android:name

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    android:name="android.support.multidex.MultiDexApplication"
    >

If also an error than compile

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

Instead OF

compile'com.google.android.gms:play-services-maps:8.4.0'

Solution 2:

After followed Er. Arjun saini answer referred to adding multidex & licence and I have corrected adding facebook sdk to solve this issue:

previously, I had added the Facebook library by adding import module.

Wrong Way :

compile project(':facebook')

Right Way:

compile 'com.facebook.android:facebook-android-sdk:4.5.0'

And also In top-level build.gradle:

allprojects {
    repositories {
        jcenter()       // This is the default repomavenCentral()  //  This is the Maven Central repo
    }
}

Post a Comment for "Studio : Execution Failed For Task App:transformclasseswithjarmergingfordebug"