-1

I have just added parse to my Android Aplication and now i can't run the app i keep getting this error:

Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command 'C:\ProgramFiles\Java\jdk1.8.0_20\bin\java.exe'' finished with non-zero exit value 2

i have tried to increase the heap size in the build.gradle with:

dexOptions {
    javaMaxHeapSize "4g"
}

but it still won't run

Here is my build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "com.example.hadi.do2get"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
packagingOptions {
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
}
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g"
}

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.android.support:design:23.1.0'
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
}

How do i fix it?

Muddi
  • 39
  • 8

4 Answers4

0

Did you put

defaultConfig {
    // Enabling multidex support.
    multiDexEnabled true
}

in the android { tag?

EDIT

Following those two links:

Error:Execution failed for task ':app:dexDebug'

Android Studio: Error:Execution failed for task ':app:dexDebug'

It seems that you are including a same library several time. You can try to remove the lines after compile fileTree(dir: 'libs', include: ['*.jar']) one by one until you find the redundant include.

Community
  • 1
  • 1
Virthuss
  • 3,142
  • 1
  • 21
  • 39
  • Yes, i will put my build.gradle file here – Muddi Jan 07 '16 at 03:47
  • I have tried to delete them one by one but i still get errors I can't delete the last two lines: compile 'com.parse.bolts:bolts-android:1.+' compile 'com.parse:parse-android:1.+' because i got them from parse so i have to write them in the build.gradle file – Muddi Jan 07 '16 at 04:25
  • When i compile my application with the build.gradle file that is in here i get the error: Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: com/parse/AbstractQueryController$1.class – Muddi Jan 07 '16 at 04:28
  • Look there, thats the exact same problem: http://stackoverflow.com/questions/33254883/establishing-parse-connection-with-a-sample-android-activity-errorexecution-fa and it seems that its actually linked with a redundant compile I was talking about – Virthuss Jan 07 '16 at 04:37
  • I have looked at it, but i im not including two parse libaries like the one in the link – Muddi Jan 07 '16 at 05:03
0

replace

compile 'com.parse.bolts:bolts-android:1.+'

with

compile 'com.parse.bolts:bolts-tasks:1.3.0'
compile 'com.android.support:multidex:1.0.1'
Deepak John
  • 967
  • 1
  • 7
  • 19
0

The problem is on the file, you need to add the dependencies to the another build.gradle file in the gradle folder

ToniApps
  • 88
  • 1
  • 11
0

I figured it out, the bolt-task.jar files were missing so i just had to import the bolt-task jar files to my libs folder in thhe project.........

Muddi
  • 39
  • 8