java.exe 以非零退出值 2 结束

时间:2023-02-13
本文介绍了java.exe 以非零退出值 2 结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前的播放服务版本是6.5.87,我升级到7.0.0然后出现这个错误

My previous play service version is 6.5.87 and I upgraded to 7.0.0 then Got this error

com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:Program FilesJavajdkx.x.x_xxinjava.exe'' 完成非零退出值 2

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:Program FilesJavajdkx.x.x_xxinjava.exe'' finished with non-zero exit value 2

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

我已经升级了播放服务然后....现在我的gradle是

I have upgraded play service Then....Now my gradle is

dependencies {
compile project(':com_facebook_android')
compile project(':pullToRefreshLib')
compile project(':smoothProgressbarLib')
compile project(':progressMaterial')
compile 'com.android.support:support-v4:22.0.0'
compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.google.code.gson:gson:2.3'
compile 'com.jakewharton:butterknife:6.1.0'
compile files('libs/android-async-http-1.4.6.jar')
compile files('libs/commons-io-2.4.jar')
compile files('libs/google-api-client-1.4.1-beta.jar')
compile files('libs/google-api-client-googleapis-1.4.1-beta.jar')
compile files('libs/jackson-core-asl-1.6.7.jar')
compile files('libs/jeval.jar')
compile files('libs/jscience.jar')
compile files('libs/libGoogleAnalyticsV2.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/universal-image-loader-1.9.3.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/guava-r09.jar')

有没有冲突库?

推荐答案

没有人回答.我发现....解决方案是multidex

No one answered. I found.... The solution is multidex

public class MyApplication extends MultiDexApplication {

@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
}

}

在清单文件中

<application
        android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:theme="@style/Theme.MyAppTheme">

我的 gradle 文件

My gradle file

android {
compileSdkVersion 21
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.winapp"
    minSdkVersion 14
    targetSdkVersion 21
    multiDexEnabled = true
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}

packagingOptions {
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/LICENSE.txt'
}

dexOptions {
    preDexLibraries = false
    incremental true
    javaMaxHeapSize "4g"
}

afterEvaluate {
    tasks.matching {
        it.name.startsWith('dex')
    }.each { dx ->
        if (dx.additionalParameters == null) {
            dx.additionalParameters = ['--multi-dex']
        } else {
            dx.additionalParameters += '--multi-dex'
        }
    }
}
}

这篇关于java.exe 以非零退出值 2 结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

上一篇:Android Studio:Gradle 产品风味:定义自定义属性 下一篇:不同安卓风格的通用代码

相关文章

最新文章