这个问题在这里已有答案:
我正在尝试运行我的项目,但由于某种原因它给了我这个错误
错误:任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'的执行失败。 com.android.builder.dexing.DexArchiveMergerException:无法合并dex
我看到了一些解决方案,但没有一个能帮助我。我在这里缺少什么?
摇篮
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
multiDexEnabled true
applicationId "com.world.bolandian.talent"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-messaging:11.6.0'
implementation 'com.google.firebase:firebase-storage:11.6.0'
implementation 'com.google.firebase:firebase-database:11.6.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core: 2.2. 2 ', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.beardedhen:androidbootstrap:2.3.2'
compile 'com.github.mukeshsolanki:country-picker-android:1.1.9'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:support-v4:26.+'
compile 'com.mikhaellopez:circularimageview:3.0.2'
compile 'com.github.clans:fab:1.6.4'
compile 'com.firebaseui:firebase-ui-auth:3.1.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
添加Gradle
defaultConfig {
multiDexEnabled true
}
dependencies {
compile 'com.android.support:multidex:1.0.1'}
在Android Manifest中
<application
android:name="android.support.multidex.MultiDexApplication"
...........
FirebaseUI严格依赖于您必须遵守的固定Firebase / Play服务版本。你好,你的版本不同步。
你用:
compile 'com.firebaseui:firebase-ui-auth:3.1.0'
然后
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-messaging:11.6.0'
implementation 'com.google.firebase:firebase-storage:11.6.0'
implementation 'com.google.firebase:firebase-database:11.6.0'
但是,FirebaseUI 3.1.0需要Firebase / Play Services 11.4.2。
FirebaseUI的下一个版本是3.1.2,需要Firebase / Play Services 11.6.2。
对于完整和未来的参考 - FirebaseUI-Android dependencies list。