---
title: "finished with non zero exit value"
author: "biandroid"
date: "2016-03-25T21:14:12Z"
tags: []
categories: ["移动开发"]
slug: "finished-with-non-zero-exit-value"
draft: false
lastmod: "2016-03-25T21:14:12Z"
id: 2286334
url: "https://biandroid.iteye.com/blog/2286334"
---

For return value 3 "OutOfMemory exception" i added following in gradle android section

```
android {............
dexOptions {
    incremental =true;
    preDexLibraries =false
    javaMaxHeapSize "4g"// 2g should be also OK}............}
```

And for 2nd issue with return value 2, earlier i had following in gradle dependencies for JDK 7 

```
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services:7+'
compile 'com.facebook.android:facebook-android-sdk:+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:support-v4:+'
```

Then i updated my JDK to 8 and it started to give me error (probably for jdk 8 there were more than one libs available with 7+ ) while running the application. What fixed my issue is giving specific version instead of 7+. i.e. 

```
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
compile 'com.android.support:support-v4:23.1.0'
```