【发布时间】:2016-03-16 08:28:59
【问题描述】:
我可能已经尝试了有关此问题的所有解决方案。 完整的错误是:错误:任务“执行失败”
':app:transformClassesWithDexForDebug'.
> 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 脚本: 脚本名称:RajawaliCardBoardExample-master
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
名称:模块:app >>
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
dexOptions {
incremental true
javaMaxHeapSize "4g"
jumboMode = true
}
defaultConfig {
applicationId "com.eje_c.rajawalicardboard"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':rajawalicardboard')
compile project(':lib_panorama_max')
compile 'com.android.support:multidex:1.0.1'
}
名称:模块:lib_panorama_max >>
apply plugin: 'java'
task nativeLibsToJar(type: Zip, description: 'create a jar archive of the native libs') {
destinationDir file("$buildDir/native-libs")
baseName 'native-libs'
extension 'jar'
from fileTree(dir: 'libs', include: '**/*.so')
into 'lib/'
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(nativeLibsToJar)
options.encoding = "UTF-8"
options.debug = true
options.debugOptions.debugLevel = "source,lines,vars"
options.encoding = "UTF-8"
}
dependencies {
compile files('libs/commons-httpclient-3.1.jar')
compile files('libs/android.jar')
compile fileTree(dir: 'build/native-libs', include: ['*.jar'])
}
名称:模块:Rajawali >>
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
dexOptions {
incremental true
javaMaxHeapSize "2048M"
jumboMode = true
}
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
名称:模块:rajawalicardboard >>
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
dexOptions {
incremental true
javaMaxHeapSize "2048M"
jumboMode = true
}
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':rajawali')
}
请帮忙解决! :(
【问题讨论】:
-
尝试将
multiDexEnabled true也放入Module:app.. -
什么都没发生,先生。 @ShreeKrishna
标签: android android-studio library-project