[英]Getting error Error:Execution failed for task ':app:transformClassesWithDexForDebug'
[英]Getting error “Execution failed for task ':app:transformClassesWithDexForDebug”
需要幫忙。
錯誤:任務':app:transformClassesWithDexForDebug'的執行失敗。 > com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:com.android.dex.DexException:多個dex文件定義了Lcom / google / android /克/ INTE
該應用程序在api級別23上運行,但給出了api 16的上述錯誤,這是我的minsdk。
我的gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.raghavkishan.financialplanner"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
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:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
謝謝。
首先清理項目並重建,然后在項目的應用程序級別的build.gradle文件中添加以下代碼: defaultConfig { multiDexEnabled true }
在build.gradle文件中,依賴項包含以下幾行:
compile 'com.google.firebase:firebase-auth:10.2.1' compile 'com.google.firebase:firebase-database:10.0.1' compile 'com.google.android.gms:play-services-auth:10.2.1'
相反,此更改為以下幾行:
compile 'com.google.firebase:firebase-auth:10.2.1' compile 'com.google.firebase:firebase-database:10.2.1' compile 'com.google.android.gms:play-services-auth:10.2.1'
只需確保每個版本具有相同的值即可。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.