com.android.build.transform.api.TransformException with android google play services

夙愿已清 提交于 2019-12-01 04:37:20
vab
  1. Try cleaning your project and then re-building.

  2. Try adding multiDexEnabled true in your app build.gradle file.

    defaultConfig {
        multiDexEnabled true
    }
    

I have added this on the Application class:

 @Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
}

In my app build.grade file:

 defaultConfig {
    applicationId "com.example.android.exampleapp"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true

}

and added this as dependency:

     compile 'com.android.support:multidex:1.0.0'

This solved my problem. Thanks

I just had the same problem in my current project when I moved the Android Gradle Plugin Version from 1.3.0 to 1.5.0.

The error was nearly the same one as the error of the OP except that java returned error code 2.

If finally turned out that I had the same jar file included in two different modules of the app.

Version 1.3.0 could handle this without problems, for version 1.5.0 I had to replace the jar files with a dependency for a separate module that contained a single copy of the jar file.

I have tried with adding

   multiDexEnabled true

but did not work. then I have changed my build version from 23.0.2 to

  buildToolsVersion "23.0.3"

then it works. hope it may help you.

try to add these line in your gradle

dexOptions {
    javaMaxHeapSize "4g"
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!