Error converting bytecode – DexException- Firebase Auth

Home / Uncategorized / Error converting bytecode – DexException- Firebase Auth

Question:
I have just tried out Firebase auth UI. But while running the project DexException come out. I have read all readme files given in the Firebase Github, but I couldn’t find a solution. I am confused whether I missed anything. Added both gradles and error log.

My app gradle as follows:apply plugin: ‘com.android.application’
apply plugin: ‘kotlin-android’

apply plugin: ‘kotlin-android-extensions’

android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.writein.results"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’
}
}
packagingOptions {
exclude ‘META-INF/LICENSE’
exclude ‘META-INF/LICENSE-FIREBASE.txt’
exclude ‘META-INF/NOTICE’
}
}

dependencies {
implementation fileTree(dir: ‘libs’, include: [‘*.jar’])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
// Anko Commons
compile "org.jetbrains.anko:anko-commons:$anko_version"
//support
implementation ‘com.android.support.constraint:constraint-layout:1.0.2’
implementation "com.android.support:appcompat-v7:$supportLibVersion"
compile "com.android.support:customtabs:$supportLibVersion"
compile "com.android.support:cardview-v7:$supportLibVersion"
compile ‘com.android.support:multidex:1.0.2’
//firebase auth
compile ‘com.firebaseui:firebase-ui-auth:2.2.0’
compile "com.google.firebase:firebase-auth:$playServicesVersion"
compile "com.google.android.gms:play-services-auth:$playServicesVersion"
testImplementation ‘junit:junit:4.12’
androidTestImplementation ‘com.android.support.test:runner:1.0.0’
androidTestImplementation ‘com.android.support.test.espresso:espresso-core:3.0.0’
}

apply plugin: ‘com.google.gms.google-services’

Project gradle:
buildscript {
ext.kotlin_version = ‘1.1.3-2’
ext.anko_version = ‘0.10.0’
ext.playServicesVersion = ‘11.0.4’
ext.supportLibVersion = ‘25.4.0’
repositories {
google()
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.0.0-beta2’
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath ‘com.google.gms:google-services:3.1.0’
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Error :

FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ‘:app:transformDexArchiveWithDexMergerForDebug’.

com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lcom/google/firebase/iid/zzd;


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *