错误
错误:任务':app:transformClassesWithDexForDebug'的执行失败.com.android.build.transform.api.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'command'/ usr/lib/jvm/java-8-oracle/bin/java''以非零退出值1结束
我的app gradle文件:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId 'Hidden application ID'
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
disable 'InvalidPackage'
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
productFlavors {
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:multidex:1.0.1' …Run Code Online (Sandbox Code Playgroud) android android-studio android-gradle-plugin android-multidex
我是Android Studio的新手,我一直在使用eclipse,但由于65K我的项目中的错误,我需要将其迁移到Android Studio.在跑步的时候
./gradlew assembleDebug
我收到错误说: -
Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException:
Process 'command '/opt/jdk/jdk1.8.0_45/bin/java'' finished with non-zero exit value 1
Run Code Online (Sandbox Code Playgroud)
我知道这是将eclipse项目迁移到Android Studio时非常常见的错误.
并且相信我,我搜索了许多具有相同问题的链接,并尝试了他们在答案中提到的所有内容,但不是为我工作
这是我得到的链接: -
任务':app:transformClassesWithDexForDebug'的执行失败 - Gradle依赖?
在为Android实施Google登录时,任务':app:transformClassesWithDexForDebug'的执行失败
Android Studio TransformException:错误:任务':app:transformClassesWithDexForDebug'的执行失败
错误:任务':app:transformClassesWithDexForDebug'的执行失败
com.android.build.transform.api.TransformException
https://github.com/journeyapps/zxing-android-embedded/issues/110
还有很多
我尝试了每个解决方案,我尝试.jar在我的项目中逐个添加文件,我只使用那些在我的项目中使用的Google服务包,我甚至添加了multidexjar.But没有什么可以帮助我
这是我的Build.gradle文件: -
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.petzview.android"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles …Run Code Online (Sandbox Code Playgroud) 当我尝试在Android Studio上运行App时出现此错误:
错误:任务':app:transformClassesWithDexForAvsDebug'的执行失败.com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\ Program Files\Android\Android Studio\jre\bin\java.exe''以非零退出值2结束
添加multiDexEnabled true没有解决问题.
这些是gradle文件:
的build.gradle(模块:应用):
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
apply plugin: 'jp.leafytree.android-scala'
apply plugin: 'android-apt'
apply plugin: 'hugo'
apply plugin: 'com.mutualmobile.gradle.plugins.dexinfo'
apply from: 'config/quality.gradle'
repositories {
flatDir {
dirs 'libs'
}
}
android {
//Trigger the licenseFormat task at least once in any compile phase
applicationVariants.all { variant ->
variant.javaCompiler.dependsOn(rootProject.licenseFormat)
}
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
multiDexEnabled true
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode System.getenv("BUILD_NUMBER") as Integer ?: 99999
versionName rootProject.ext.majorVersion …Run Code Online (Sandbox Code Playgroud) 我试过以下链接
http://developer.android.com/intl/es/tools/building/multidex.html
意外的顶级异常:com.android.dex.DexException:多个 dex 文件定义
com.android.build.transform.api.TransformException
Android Studio TransformException:错误:任务':app:transformClassesWithDexForDebug'的执行失败
Java 以非零退出值 2 结束 - Android Gradle
com.android.build.transform.api.TransformException
我的gradle构建文件如下。
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "appId"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
incremental true
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile files('libs/rt.jar')
compile 'com.android.support:multidex:1.0.0' …Run Code Online (Sandbox Code Playgroud) 今天我最新的android studio到1.4版本.我在changelog中看到你可以用api <21编译带有矢量图像的应用程序.我试过了.我将gradle版本从1.3.0更改为1.4.1并实现了矢量图像而不是栅格.在构建过程中,我收到此错误:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_51\bin\java.exe'' finished with non-zero exit value 2
Run Code Online (Sandbox Code Playgroud)
对不起,我的英语不好.我希望你明白.提前致谢.