【发布时间】:2017-02-22 04:37:41
【问题描述】:
错误:任务 ':app:transformClassesWithDexForDebug' 执行失败。 com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: 没有在 C:\Users\DELL\AndroidStudioProjects\PK19\app\build\intermediates\transforms\dex\ 创建 dex 文件调试\文件夹\1000\10\instant-run_3e64ab9e373807c9050a33a8846eab1e5e4e2138
这就是我的 gradle 的样子。我使用 android studio 2.1.2
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.example.dell.pk19"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g" // 2g should be also OK
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:multidex:1.0.0'
}
如何解决这个错误?
【问题讨论】:
-
您的应用程序类是否扩展了 MultiDexApplication?
-
好像他没有使用外部库超过65K方法限制。
-
你能告诉我上面的步骤怎么做吗?
-
我是 android 和 stackoverflow 的新手。
-
试试我的链接答案我发布了所有的可能性和他们的解决方案:stackoverflow.com/questions/37497882/…
标签: android android-studio android-gradle-plugin android-multidex