简体   繁体   English

用非零退出值完成

[英]Finished with non-zero exit value

I get this error when I try to run the app 尝试运行应用程序时出现此错误

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. 错误:任务':app:transformClassesWithDexForDebug'的执行失败。 com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\\Program Files\\Java\\jdk1.7.0_25\\bin\\java.exe'' finished with non-zero exit value 2 com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'command'C:\\ Program Files \\ Java \\ jdk1.7.0_25 \\ bin \\ java.exe''的退出值非零2

Gradle: 摇篮:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.dusanp.passer"
    minSdkVersion 19
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-   android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
compile fileTree(include: 'Parse-*.jar', dir: 'libs')
compile 'com.android.support:support-v4:23.+'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/sinch-android-rtc-3.7.1.jar')
}

Android application (APK) files contain executable bytecode files in the form of Dalvik Executable (DEX) files, which contain the compiled code used to run your app. Android应用程序(APK)文件包含Dalvik可执行文件(DEX)文件形式的可执行字节码文件,其中包含用于运行您的应用程序的已编译代码。 The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536, including Android framework methods, library methods, and methods in your own code. Dalvik Executable规范将单个DEX文件中可以引用的方法总数限制为65,536,包括Android框架方法,库方法和您自己代码中的方法。 Getting past this limit requires that you configure your app build process to generate more than one DEX file, known as a multidex configuration 超过此限制要求您将应用程序构建过程配置为生成多个DEX文件,称为multidex配置。

This might be due to exceeding the 65K methods dex limit imposed by Android. 这可能是由于超出了Android规定的65K方法dex限制。 This problem can be solved either by cleaning the project, and removing some unused libraries and methods from dependencies in build.gradle, or by adding multidex support. 可以通过清理项目并从build.gradle中的依赖项中删除一些未使用的库和方法来解决此问题,也可以通过添加multidex支持来解决。

Setting up your app development project to use a multidex configuration requires that you make a few modifications to your app development project. 设置应用程序开发项目以使用multidex配置需要对应用程序开发项目进行一些修改。 In particular you need to perform the following steps: 特别是,您需要执行以下步骤:

  1. Change your Gradle build configuration to enable multidex 更改您的Gradle构建配置以启用Multidex
  2. Modify your manifest to reference the MultiDexApplication class 修改清单以引用MultiDexApplication类

Here is the complete details: https://developer.android.com/tools/building/multidex.html 这是完整的详细信息: https : //developer.android.com/tools/building/multidex.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM