首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android Studio: java.exe结束,退出值非零2

Android Studio: java.exe结束,退出值非零2
EN

Stack Overflow用户
提问于 2015-10-24 07:30:36
回答 2查看 589关注 0票数 1

Android Studio新手。

我刚刚创建了一个新的空白应用程序,并添加了一个新的Google Cloud Module。在添加模块后,我得到了错误:

代码语言:javascript
复制
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)

代码语言:javascript
复制
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 (模块:后端)

代码语言:javascript
复制
// 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
    }
}

我没有看到任何重复的东西,我也没有在版本号上使用'+‘,这似乎解决了其他人的问题。我还没有添加/修改或修补项目,禁止添加模块。在添加模块之前,它会正确编译。

EN

回答 2

Stack Overflow用户

发布于 2015-12-06 20:59:40

在gradle文件中添加此行

代码语言:javascript
复制
defaultConfig {        
    // Enabling multidex support.
    multiDexEnabled true
}
票数 0
EN

Stack Overflow用户

发布于 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'

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33312880

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档