我的 gradle.build 文件如下所示:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.alexandernohe.mapsappgoogle"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.maps.android:android-maps-utils:0.4.3'
compile 'com.firebase:firebase-client-android:2.5.1+'
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:design:23.2.1'
}
我已启用多重索引并尝试删除 app/build 文件夹,但我的应用程序仍然无法构建。如果我删除设计库,它将构建,但随后我无法在 fragment 中使用 float 操作按钮,也无法使用协调的布局。此处引用帖子中的大多数当前解决方案都启用了多重索引,但是,查看构建文件,您应该看到它已启用。我有一种感觉,列出的库可能与设计库重叠,但据我根据谷歌文档所知,它们是不同的。
错误代码如下:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. >com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3
编辑: 我忘记说了,我也对这个项目进行了清理。
最佳答案
在 build.gradle 的 android block 中尝试一下:
dexOptions {
javaMaxHeapSize "4g"
}
关于java - Gradle 构建因 TransformException 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36121789/