0

I am building an app where I am using code for Fused provider from this tutorial link but when I want to run my app I receive this error:

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

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with non-zero exit value 1

This is my Gradle file:

apply plugin: 'com.android.application'

android { compileSdkVersion 23 buildToolsVersion "24.0.0" dexOptions { javaMaxHeapSize "4g" }

defaultConfig {
    applicationId "com.example.dev3.fusedtutorial"
    minSdkVersion 9
    targetSdkVersion 23
    multiDexEnabled true
    versionCode 1
    versionName "1.0"
}
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.google.android.gms:play-services:9.2.0' }

Can anyone help me?

  • Maybe it is caused by mismatch in the versions of SDK, Build Tools And Gradle Plugins, Try to verify if you are using the latest version of them. Then try to clean and run the project. Also check the solution in this [SO question](http://stackoverflow.com/questions/36561103/apptransformclasseswithmultidexlistfordebug-failed). This SO question has a lot of reference link, you can also check them. – KENdi Jun 29 '16 at 23:53

1 Answers1

0

Add below to your build.gradle of app level:

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"


defaultConfig {
     applicationId "com.example.dev3.fusedtutorial"
     minSdkVersion 9
     targetSdkVersion 23
     multiDexEnabled true
     versionCode 1
     versionName "1.0"

}

dexOptions {
    incremental true
    javaMaxHeapSize "4g"
}
}

Or add an Application class as below:

public class MyApplication extends Application {

@Override
public void onCreate() {
    MultiDex.install(getApplicationContext());
    super.onCreate();

    }
 }

And do not forget to edit your application name in manifest.

 <application
    android:name=".MyApplication"
    ................
 </application>
Dhruvi
  • 1,971
  • 2
  • 10
  • 18