Android Studio新手。
我刚刚创建了一个新的空白应用程序,并添加了一个新的Google Cloud Module。在添加模块后,我得到了错误:
Error:Execution failed for task ':app:dexDebug'.
> 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 2我已经阅读了StackOverflow上的多个答案,所有的答案都表明gradle依赖存在错误,但我看不到一个错误。下面是我的两个gradle文件:
build.gradle (模块: app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.bristow.conor.intellipa"
minSdkVersion 23
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.1.0'
compile 'com.google.android.gms:play-services:8.1.0'
compile project(path: ':backend', configuration: 'android-endpoints')
}build.gradle (模块:后端)
// If you would like more information on the gradle-appengine-plugin please refer to the github page
// https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.18'
}
}
repositories {
jcenter();
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.18'
compile 'com.google.appengine:appengine-endpoints:1.9.18'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.18'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.googlecode.objectify:objectify:4.0b3'
compile 'com.ganyo:gcm-server:1.0.2'
}
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
}我没有看到任何重复的东西,我也没有在版本号上使用'+‘,这似乎解决了其他人的问题。我还没有添加/修改或修补项目,禁止添加模块。在添加模块之前,它会正确编译。
发布于 2015-12-06 20:59:40
在gradle文件中添加此行
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}发布于 2015-12-06 20:39:32
使用compile 'com.google.android.gms:play-services-gcm:8.3.0'而不是'com.google.android.gms:play-services:8.1.0'
https://stackoverflow.com/questions/33312880
复制相似问题