[英]Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. after adding extenal library
[英]Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. while adding firebase authentication
整天都在遭受這個錯誤的困擾。
請不要將此問題標記為重復。我經歷過許多類似的問題,但沒有一個答案對我有用。
完全錯誤:
Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> java.io.IOException: Can't write [E:\Educational\Career\Android\Projects
\FirebaseTutorial\app\build\intermediates\multi-dex\debug\componentClasses.jar]
(Can't read [C:\Users\Abhi\.gradle\caches\transforms-1\files-1.1\support-core-ui-
27.1.0.aar\167562b027fa4c1af2f69bce0de3dd43\jars\classes.jar(;;;;;;**.class)]
(Duplicate zip entry [classes.jar:android/support/design/widget/CoordinatorLayout
$Behavior.class]))
我已經嘗試過的事情:
添加 :
android {
defaultConfig {
multiDexEnabled true
}}
分發文件:
我的完整gradle文件:
應用程式:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.appz.abhi.firebasetutorial"
minSdkVersion 19
targetSdkVersion 27
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'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.firebaseui:firebase-ui-auth:3.2.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
頂級gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
添加Firebase身份驗證后發生此錯誤。
PS:刪除firebase身份驗證依賴關系並重建項目不會顯示任何錯誤。 即刪除
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.firebaseui:firebase-ui-auth:3.2.2'
刪除錯誤,但我想在我的項目中使用Firebase Auth。
firebase firebase-ui-auth:3.2.2
支持的支持庫是27.0.2而不是27.1.0
所以改變:
implementation 'com.android.support:appcompat-v7:27.1.0'
至
implementation 'com.android.support:appcompat-v7:27.0.2'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.