我是Android开发新手并尝试运行我的项目;所以我用USB插入我自己的移动电话(Android)并运行它,但有一个错误:
Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1
Build.gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.example.axel.test"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
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:support-v4:24.0.0'
compile 'com.android.support:multidex:1.0.0'
}
答案 0 :(得分:0)
尝试改变
buildToolsVersion "24.0.0"
和
compile 'com.android.support:support-v4:24.0.0'
到
buildToolsVersion "23.0.2"
compile 'com.android.support:support-v4:23.2.0'
我认为构建工具v 24需要java 8
答案 1 :(得分:0)
请参阅this.getElementAtEvent(e)
用于超越64K方法的限制,这在Dalvik系统中是必需的。
参考链接 - https://developer.android.com/studio/build/multidex.html
从 build.gradle
中删除此行multiDexEnabled