Vavelin Kévin
Vavelin Kévin

Reputation: 80

Impossible to run app with Parse

I have an issue with Parse. I had the sdk (downloaded on Parse.com and unzip inside /libs folder in my project) and when I build everything is good.

But when I run the app,I have this following error :

Error:Execution failed for task ':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.8.0_66\bin\java.exe'' finished with non-zero exit value 2

I don't know what to do, I search and tried everything I found on StackOverflow and github repo of Parse but nothing works :/

Any idea ?

Thanks in advance for your answer.

Upvotes: 2

Views: 2801

Answers (3)

pk43
pk43

Reputation: 1

Try to add the following code to your build.gradle (module: app)

dependencies{
...
...
compile 'com.parse.bolts:bolts-android:1.+'
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
}

and no need of adding multiDex.

Hope this should work.

Upvotes: 0

Anvesh523
Anvesh523

Reputation: 368

Simple in your gradle file add these ...

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {

    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"

    // Enabling multidex support.
    multiDexEnabled true

}

 // add dexOptions
dexOptions {
    incremental true
    javaMaxHeapSize "4g"
}
}


dependencies {
provided fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.parse:parse-android:1.11.0'
 // add multidex dependency 
compile 'com.android.support:multidex:1.0.1'

}

reference: Error:Execution failed for task ':app:dexDebug' error in my project while I added new dependency

Upvotes: 7

Lucas Crawford
Lucas Crawford

Reputation: 3118

Try to clean your project (Build -> Clean Project) or try to add this:

 defaultConfig {
     multiDexEnabled true
 }

to your build.gradle file

Upvotes: 3

Related Questions