Reputation: 213
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
Reputation: 213
A duplicate in the build.gradle file was the issue. Firebaseui was causing the build error.
Upvotes: 0
Reputation: 9117
You can try any of this.. it might works
multiDexEnabled true
in your gradle defaulConfigUpvotes: 0
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
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
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
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