摇篮建立自己的错误:非零退出值1的Andr​​oid的java.exe完成 [英] Gradle build error:Android java.exe finished with non-zero exit value 1

查看:233
本文介绍了摇篮建立自己的错误:非零退出值1的Andr​​oid的java.exe完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经尝试了所有的以下链接的解决方案: 摇篮生成错误

Android的工作室摇篮错误 - preDexDebug

<一个href="http://stackoverflow.com/questions/29045129/android-java-exe-finished-with-non-zero-exit-value-1">Android java.exe的完成非零退出值1

完成非零退出值

<一个href="http://stackoverflow.com/questions/29255682/execution-failed-for-task-app$p$pdexdebug">Execution失败的任务::应用程序:preDexDebug'

http://fqa.io/questions/29045129/android-java-exe-finished-with-non-zero-exit-value-1

http://fqa.io/questions/28933701/android-studio-unable-to-resolve-error-app$p$pdexdebug

该错误仍然存​​在。任何帮助将真正成为AP preciated。谢谢!

 信息:摇篮任务[:应用程序:assembleDebug]
:应用程序:preBuild UP-TO-DATE
:应用程序:preDebugBuild UP-TO-DATE
:应用程序:compileDebugNdk UP-TO-DATE
:应用程序:checkDebugManifest
:应用程序:preReleaseBuild UP-TO-DATE
:应用程序:prepareComAndroidSupportAppcompatV72211Library UP-TO-DATE
:应用程序:prepareComAndroidSupportSupportV42211Library UP-TO-DATE
:应用程序:prepareDebugDependencies
:应用程序:compileDebugAidl UP-TO-DATE
:应用程序:compileDebugRenderscript UP-TO-DATE
:应用程序:generateDebugBuildConfig UP-TO-DATE
:应用程序:generateDebugAssets UP-TO-DATE
:应用程序:mergeDebugAssets UP-TO-DATE
:应用程序:generateDebugResValues​​ UP-TO-DATE
:应用程序:generateDebugResources UP-TO-DATE
:应用程序:mergeDebugResources UP-TO-DATE
:应用程序:processDebugManifest UP-TO-DATE
:应用程序:processDebugResources UP-TO-DATE
:应用程序:generateDebugSources UP-TO-DATE
:应用程序:compileDebugJava UP-TO-DATE
:应用程序:preDexDebug失败
错误:执行失败的任务:应用程序:preDexDebug。
&GT; com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:处理'命令'C:\ Program Files文件\的Java \ jdk1.8.0_45 \斌\ java.exe的''与非完零退出值1
 

当我运行与--debug选项便会显示错误的:

 错误:05:43:59.724 [错误] [org.gradle.BuildExceptionReporter]
05:43:59.725 [错误] [org.gradle.BuildExceptionReporter]失败:建立失败,一个例外。
05:43:59.726 [错误] [org.gradle.BuildExceptionReporter]
05:43:59.727 [错误] [org.gradle.BuildExceptionReporter] *出了什么问题:
05:43:59.728 [错误] [org.gradle.BuildExceptionReporter]执行失败的任务:应用程序:preDexDebug。
05:43:59.729 [错误] [org.gradle.BuildExceptionReporter] GT; com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:处理'命令'C:\ Program Files文件\的Java \ jdk1.8.0_45 \斌\ java.exe的''与非完零退出值1
05:43:59.732 [错误] [org.gradle.BuildExceptionReporter]
05:43:59.733 [错误] [org.gradle.BuildExceptionReporter] *尝试:
05:43:59.734 [错误] [org.gradle.BuildExceptionReporter]与--stacktrace选项获取堆栈跟踪运行。
 

和build.gradle的内容(项目:所有MyApplication)

  //顶级构建文件,你可以到各子项目/模块添加常用的配置选项。

buildscript {
    库{
        jcenter()
    }
    依赖{
        类路径com.android.tools.build:gradle:1.1.0

        //注意:不要在这里放置应用程序依赖;他们属于
        //在单个模块build.gradle文件
    }
}

allprojects {
    库{
        jcenter()
    }
}
 

build.gradle内容(模块:应用程序):

 应用插件:com.android.application

安卓{
    compileSdkVersion 21
    buildToolsVersion21.1.2

    defaultConfig {
        的applicationIDcom.example.user.myapplication
        的minSdkVersion 8
        targetSdkVersion 21
        版本code 1
        VERSIONNAME1.0
    }
    buildTypes {
        推出 {
            minifyEnabled假
            proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'proguard-rules.pro
        }
    }
}

依赖{
    编译文件树(导演:库,包括:['的* .jar'])
    编译com.android.support:appcompat-v7:22.1.1
}
 

解决方案

我突然得到了同样的错误,我意识到这是因为发生了新的谷歌游戏服务库。

我改变了这一行

编译com.google.android.gms:玩-服务:7.3.0

返回

编译com.google.android.gms:玩-服务:7.0.0

和我能再次运行该应用程序。当我更新到7.3.0,问题再次出现(每一次)。

我使用的是Android 1.2演播室,摇篮插件1.2.2,compileSdkVersion 22,buildToolsVersion 22.0.1。

Have tried out the solution on all the following links: Gradle Build Errors

Android Studio Gradle Error - preDexDebug

Android java.exe finished with non-zero exit value 1

finished with non zero exit value

Execution failed for task: ':app:preDexDebug'

http://fqa.io/questions/29045129/android-java-exe-finished-with-non-zero-exit-value-1

http://fqa.io/questions/28933701/android-studio-unable-to-resolve-error-apppredexdebug

The error still remains. Any help will truly be appreciated. Thanks!

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72211Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42211Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:preDexDebug FAILED
Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 1

and when i run with --debug option it displays the error as:

Error:05:43:59.724 [ERROR] [org.gradle.BuildExceptionReporter] 
05:43:59.725 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
05:43:59.726 [ERROR] [org.gradle.BuildExceptionReporter] 
05:43:59.727 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
05:43:59.728 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':app:preDexDebug'.
05:43:59.729 [ERROR] [org.gradle.BuildExceptionReporter] > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 1
05:43:59.732 [ERROR] [org.gradle.BuildExceptionReporter] 
05:43:59.733 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
05:43:59.734 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. 

And the contents of build.gradle(Project:MyApplication)

// 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.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

Contents of build.gradle(Module:app):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.user.myapplication"
        minSdkVersion 8
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.1'
}

解决方案

I suddenly got the same error and I realized it was happening because of the new Google Play Services library.

I changed this line

compile 'com.google.android.gms:play-services:7.3.0'

back to

compile 'com.google.android.gms:play-services:7.0.0'

and I can run the app again. As soon as I update to 7.3.0, the problem reappears (every single time).

I'm using Android Studio 1.2, gradle plugin 1.2.2, compileSdkVersion 22, buildToolsVersion 22.0.1.

这篇关于摇篮建立自己的错误:非零退出值1的Andr​​oid的java.exe完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆