过去3个小时我一直在寻找类似的问题,我觉得我已经尝试了一切,但没有成功。我试图通过模拟器运行应用程序,但它一直返回'transformClassesWithMultidexlistForDebug'
错误。程序在没有错误的情况下构建,只是当我通过模拟器运行时它会导致我出现问题。下面是我的应用程序gradle以及错误消息:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.moa.gsrental.rentalinventory"
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:+'
compile 'com.android.support:multidex:1.0.0'
}
错误讯息:
Preparing output jar [C:\Users\Omar\AndroidStudioProjects\Rentalinventory\app\build\intermediates\multi-dex\debug\componentClasses.jar]
Copying resources from program jar [C:\Users\Omar\AndroidStudioProjects\Rentalinventory\app\build\intermediates\transforms\jarMerging\debug\jars\1\1f\combined.jar]
:app:transformClassesWithMultidexlistForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
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
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
任何帮助将不胜感激!
答案 0 :(得分:0)
好的我已经解决了这个问题,但我不知道怎么做。我基本上只是打开了一个不同的android studio项目的示例代码,并模仿了build.gradle。感谢所有看过我问题的人!