Adding JsonPath in Android Studio causes non-zero exit value 2 error

When I add the JsonPath library to my Android Studio (1.4) project I get an error as following:

Error:Execution failed for task ':app:dexDebug'. \>
Process 'command 'C:\Program Files\JDK_64_bit\bin\java.exe'' finished with 
non-zero exit value 2

(I added the library via File > Project Structure > Dependencies > Library Dependency > com.jayway.jsonpath:json-path:2.0.0)

Trying to add MultiDex support for the app as suggested in a few other questions results in a different error:

Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. \> duplicate entry:

The external libraries in my project list both asm-1.0.2 and asm-3.3.1 but removing one or both does not solve my problem.


apply plugin: ''

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.example.REDACTED.REDACTED"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), ''


dependencies {

compile fileTree(include: ['*.jar'], dir: 'libs')
compile ''
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.jayway.jsonpath:json-path:2.0.0'
compile ''

app.iml (libraries):

    <orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" exported="" name="butterknife-7.0.1" level="project" />
    <orderEntry type="library" exported="" name="asm-3.3.1" level="project" />
    <orderEntry type="library" exported="" name="multidex-1.0.1" level="project" />
    <orderEntry type="library" exported="" name="json-path-2.0.0" level="project" />
    <orderEntry type="library" exported="" name="asm-1.0.2" level="project" />
    <orderEntry type="library" exported="" name="support-v4-23.1.0" level="project" />
    <orderEntry type="library" exported="" name="slf4j-api-1.7.10" level="project" />
    <orderEntry type="library" exported="" name="appcompat-v7-23.1.0" level="project" />
    <orderEntry type="library" exported="" name="support-annotations-23.1.0" level="project" />
    <orderEntry type="library" exported="" name="json-smart-2.1.1" level="project" />


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
    package="com.example.REDACTED.REDACTED" >
    <uses-permission android:name="android.permission.INTERNET" />


            android:label="@string/app_name" >

                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />


Thank you very much in advance!

That usually means you have 2 different versions of the same library referenced somewhere

Have you tried putting:
multiDexEnabled = true

in your defaultConfig section?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.