我目前正在開發一個自定義主題版本的谷歌地圖,並花了過去上帝知道多久試圖解決此構建錯誤。我對此進行了廣泛的研究,發現似乎無助於解決我的問題。谷歌地圖Android應用程序生成錯誤:應用程序:transformClassesWithDexForDebug
我已經包含下面
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.wtwelectronics.googlemapsrev2"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
incremental true
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
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.google.android.gms:play-services:10.2.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
}
的gradle這個控制檯輸出的第一個錯誤行我的應用程序/文件的build.gradle低於:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
我採用了android 2.3.1工作室,與最新的SDK包等。
在此先感謝。
您是否嘗試過清潔和再次建築? –
可能是'google-services.json'丟失 –
構建 - > make項目/ clean項目/重建全部成功完成,我已經嘗試了一百萬次,這個問題只出現在android工作室試圖建立一個apk文件。 – wtw