Android 错误:任务';的执行失败:应用程序:TransformClasses with DexForLegacyDebug';
获取错误“错误:任务执行失败”:app:transformClassesWithDexForLegacyDebug” com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:java.lang.UnsupportedOperationException“Android 错误:任务';的执行失败:应用程序:TransformClasses with DexForLegacyDebug';,android,Android,获取错误“错误:任务执行失败”:app:transformClassesWithDexForLegacyDebug” com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:java.lang.UnsupportedOperationException“ 您可以尝试清理项目,重
您可以尝试清理项目,重新生成它。可能还可以。1.尝试清除缓存并重新生成 在路径文件>清除缓存>清除缓存并重新启动
dexOptions{
javaMaxHeapSize“4g”
}
默认配置{
多索引启用真
}
添加multidexEnabled true后是否清除了缓存的可能重复项?另外添加'dexOptions{javaMaxHeapSize“4g”}@uwaisaleem请检查编辑的答案希望它有助于我在添加multidexEnabled后清除缓存,并且dexoption已经添加了javaMaxHeapSize“3g”,但在使其成为4g之后,我收到了相同的错误和一些其他错误。请尝试删除应用插件:“com.google.gms.google services”。删除应用插件“com.google.gms.google services”后,它可能与其他库发生冲突。相同的问题是:“com.google.gms.google services”
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
// needed for okHttp from 23sdk. https://medium.com/android-news/android-networking-i-okhttp-volley-and-gson-72004efff196#.gsfpn3ez8
useLibrary 'org.apache.http.legacy'
dexOptions {
javaMaxHeapSize "3g"
}
defaultConfig {
applicationId "bf.io.openshop"
minSdkVersion 15
targetSdkVersion 23
versionCode 2
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
multiDexEnabled true
debuggable true
versionNameSuffix '-DEBUG'
}
release {
minifyEnabled false
debuggable true
}
}
testOptions {
unitTests.returnDefaultValues = true
}
productFlavors {
Modern {
minSdkVersion 23
}
Legacy {
minSdkVersion 15
}
}
sourceSets {
androidTest {
resources.srcDirs += ['src/androidTest/resources']
}
}
}
task clearData(type: Exec) {
def clearDataCommand = ['adb', 'shell', 'pm', 'clear', 'bf.io.openshop']
commandLine clearDataCommand
}
repositories { mavenCentral() }
dependencies {
// if needed jar libraries, add them to libs folder and load them here:
// compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.jakewharton.timber:timber:4.1.2'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'mbanje.kurt:fabbutton:1.2.1'
compile 'com.facebook.android:facebook-android-sdk:4.9.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support.test.espresso:espresso-idling-resource:2.2.2'
compile 'com.android.support:multidex:1.0.0'
//// Unit testing dependencies
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-all:1.10.19'
// Set this dependency if you want to use the Hamcrest matcher library
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'org.powermock:powermock-module-junit4:1.6.4'
testCompile 'org.powermock:powermock-api-mockito:1.6.4'
//// Instrumentation test dependencies
androidTestCompile 'com.android.support:support-annotations:23.4.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2'
}
apply plugin: 'com.google.gms.google-services'