Pooveshin
Pooveshin

Reputation: 213

Error while building apk file

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.

Upvotes: 0

Views: 391

Answers (6)

Pooveshin
Pooveshin

Reputation: 213

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

Upvotes: 0

ZeroOne
ZeroOne

Reputation: 9117

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

Upvotes: 0

Sachit karki
Sachit karki

Reputation: 72

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'
        }
    }
}

Upvotes: 0

petrumo
petrumo

Reputation: 1116

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.

Upvotes: 1

Vadivel
Vadivel

Reputation: 778

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

Upvotes: 1

Hakim  Khan
Hakim Khan

Reputation: 317

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.

Upvotes: 0

Related Questions