错误:任务“:app:transformClassesWithDexForDebug”执行失败。以非零退出值 1 结束
Posted
技术标签:
【中文标题】错误:任务“:app:transformClassesWithDexForDebug”执行失败。以非零退出值 1 结束【英文标题】:Error:Execution failed for task ':app:transformClassesWithDexForDebug'. finished with non-zero exit value 1 【发布时间】:2017-05-31 03:25:40 【问题描述】:错误:任务 ':app:transformClassesWithDexForDebug' 执行失败。
com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process .ProcessException: org.gradle.process.internal.ExecException: Process 'command 'E:\androidWare\jdk1.7\bin\java.exe'' 以非零退出值 1 结束 我的应用程序 gradle 文件
apply plugin: 'com.android.application'
android
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig
applicationId "com.wjc.wjcrun"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
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.2.1'
dependencies
compile "org.igniterealtime.smack:smack-android:4.1.0-rc1"
compile "org.igniterealtime.smack:smack-tcp:4.1.0-rc1"
这是项目构建 Gradle
buildscript
repositories
jcenter()
dependencies
classpath 'com.android.tools.build:gradle:2.1.3'
allprojects
repositories
jcenter()
task clean(type: Delete)
delete rootProject.buildDir
【问题讨论】:
【参考方案1】:像这样使用你的 build.gradle。
apply plugin: 'com.android.application'
android
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig
applicationId "com.wjc.wjcrun"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
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.2.1'
compile "org.igniterealtime.smack:smack-android:4.1.0-rc1"
compile "org.igniterealtime.smack:smack-tcp:4.1.0-rc1"
【讨论】:
以上是关于错误:任务“:app:transformClassesWithDexForDebug”执行失败。以非零退出值 1 结束的主要内容,如果未能解决你的问题,请参考以下文章
Visual Studio 错误:“无法激活后台任务。后台任务激活失败。”