0

Whenever i try to build my apk file it fails with following error.

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.dex.DexException: Multiple dex files define Lcom/google/android/gms/auth/api/signin/internal/zzf;

Please help.

Thanks.

Rahul Sharma
  • 2,867
  • 2
  • 27
  • 40
Pooveshin
  • 203
  • 5
  • 13

6 Answers6

1
Just try this code:

  useLibrary 'org.apache.http.legacy'
  multiDexEnabled true


public class MyApp extends Application {


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

}

manifestfile:

    <application
    android:name="com.activity.MyApp"
    android:allowBackup="true"
    ....
   <activity name...../>
   />//application
Vadivel
  • 780
  • 1
  • 6
  • 21
1

It complains about duplicate package, com/google/android/gms/auth, you can try a gradle clean / clean project as a simple step. If this doesn't work it means that somewhere in the project dependencies you are including this package more than one time.

petrumo
  • 1,116
  • 9
  • 18
0

Just go to build tab and choose clean project. After clean project completed make rebuild project. then run your project.

i hope this will solve your problem.

Hakim Khan
  • 317
  • 5
  • 9
0

please add this code in build.gradle(module:app)

    afterEvaluate {
    tasks.matching {
        it.name.startsWith('dex')
    }.each { dx ->
        if (dx.additionalParameters == null) {
            dx.additionalParameters = ['--multi-dex']
        } else {
            dx.additionalParameters += '--multi-dex'
        }
    }
}
0

You can try any of this.. it might works

  1. Clean and rebuild the module or,
  2. Invalidate / restart android studio or,
  3. Check Gradle dependencies duplicate and clean the gradle at the right taskbar or,
  4. add multiDexEnabled true in your gradle defaulConfig
ZeroOne
  • 8,996
  • 4
  • 27
  • 45
0

A duplicate in the build.gradle file was the issue. Firebaseui was causing the build error.

Pooveshin
  • 203
  • 5
  • 13