1

I followed the documentation at https://parse.com/docs/android/guide#users-facebook-users build.gradle

apply plugin: 'com.android.application'



    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.2"

        defaultConfig {
            applicationId "com.test.app"
            minSdkVersion 15
            targetSdkVersion 22
            versionCode 1
            versionName "1.0"

            multiDexEnabled true

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

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile 'com.android.support:multidex:1.0.0'
        compile 'com.android.support:support-v4:23.1.1'
        compile 'com.squareup.picasso:picasso:2.5.2'
        compile project(':volley')
        compile 'com.parse.bolts:bolts-tasks:1.3.0'
        compile 'com.parse.bolts:bolts-applinks:1.3.0'
        compile 'com.parse:parse-android:1.12.0'
        compile 'com.facebook.android:facebook-android-sdk:4.7.0'
        compile 'com.parse:parsefacebookutils-v4-android:1.10.3@aar'
    }

but when application is run it gives the error **Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: bolts/AggregateException.class**

any help appreciated

Deepak John
  • 967
  • 1
  • 7
  • 19

2 Answers2

1

now my build.gradle

apply plugin: 'com.android.application'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.test.myapp"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"

        multiDexEnabled true

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

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')

    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile project(':volley')
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.parse.bolts:bolts-tasks:1.3.0'
    compile 'com.parse.bolts:bolts-applinks:1.3.0'
    compile('com.facebook.android:facebook-android-sdk:4.8.2') {
        exclude module: 'bolts-android'
    }
    compile 'com.parse:parse-android:1.11.0'
    compile project(':ParseFacebookUtils')
}

instead of adding ParseFacebookUtils by using compile 'com.parse:parsefacebookutils-v4-android:1.10.3@aar' in gradle file. I dowloaded the zip from https://github.com/ParsePlatform/ParseFacebookUtils-Android and unzipped it and added it to dependency by going to project structure>import eclipse ADT project and then added it to app depdencies

Deepak John
  • 967
  • 1
  • 7
  • 19
0

Actually, I guess your problem is solved in the doc:

Bolts includes:

"Tasks", which make organization of complex asynchronous code more manageable. A task is kind of like a JavaScript Promise, but available for iOS and Android.

An implementation of the App Links protocol, helping you link to content in other apps and handle incoming deep-links.

So what I understand from that is that App Link is already in the framework and that you'll just create conflicts by including it again.

If you're still blocked: here is a build which works really well (it is in prod since 6 months):

dependencies {
     compile fileTree(dir: 'libs', include: ['*.jar'])
     compile 'com.facebook.android:facebook-android-sdk:4.0.0'
     compile 'com.parse.bolts:bolts-android:1.+'
     compile 'com.android.support:multidex:1.0.0'
     compile project(':Parse')
     compile project(':ParseCrashReporting')
     compile project(':ParseFacebook')

I guess that I had problems too or maybe at that time the libs were not available on gradle so I put the JARs as module of my app. To do so: follow the guide (there are other methods, but it is the one I prefer). I use Parse 1.1.0 and all v.1.10.1 of the submodules but I'm sure it'll work as well for the other versions.

Community
  • 1
  • 1
Laurent Meyer
  • 2,766
  • 3
  • 33
  • 57