0

I am developing an application where I need to sync google calendar. I followed google api documentation but I get an error duplicate entry: com.google/common/annotations/GwtIncompatible.class. I tried searching for an answer and it seems I have an error in my app file. Below is my app file. Any help will be greatly appreciated.

 apply plugin: 'com.android.application'
 android {
 signingConfigs {
    debug {
        keyAlias 'androiddebugkey'
        keyPassword 'android'
        storeFile file('debug.jks')
        storePassword 'android'
    }
    release {
        keyAlias 'Appointment'
        keyPassword 'vnv3BqMrDvKMbyGx'
        storeFile file('release.jks')
        storePassword 'ZwedHDALbZmprkbt'
    }
}
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
    applicationId "nl.dtt.appointment"
    minSdkVersion 18
    targetSdkVersion 23
    versionCode 1
    multiDexEnabled true
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release
        debuggable true
    }
    debug {
        signingConfig signingConfigs.debug
    }
}

productFlavors {
}

}

  dependencies {
   compile fileTree(include: ['*.jar'], dir: 'libs')
   testCompile 'junit:junit:4.12'
   compile 'de.hdodenhof:circleimageview:2.0.0'
   compile 'com.android.support:support-v4:23.3.0'
   compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:preference-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'

compile 'com.marshalchen.ultimaterecyclerview:library:0.3.18'
compile 'se.emilsjolander:stickylistheaders:2.1.5'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.google.code.gson:gson:2.5'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
compile 'net.danlew:android.joda:2.9.1'
compile 'com.github.alamkanak:android-week-view:1.2.6'
compile 'com.prolificinteractive:material-calendarview:1.2.0'
compile 'com.mcxiaoke.volley:library:1.0.18'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
compile 'com.github.tibolte:agendacalendarview:1.0.3'

compile 'com.google.android.gms:play-services-location:8.4.0'
 compile 'com.google.android.gms:play-services-maps:8.4.0'
 /*
compile 'com.google.android.gms:play-services-identity:8.4.0'
 */
compile 'pub.devrel:easypermissions:0.1.5'

compile('com.google.api-client:google-api-client-android:1.20.0') {
    exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-calendar:v3-rev125-1.20.0') {
    exclude group: 'org.apache.httpcomponents'
}

compile 'com.facebook.android:facebook-android-sdk:4.0.0'

}

Boris
  • 213
  • 4
  • 13
  • I guess the error comes from these two lines compile('com.google.api-client:google-api-client-android:1.20.0') { exclude group: 'org.apache.httpcomponents' } compile('com.google.apis:google-api-services-calendar:v3- rev125-1.20.0') { exclude group: 'org.apache.httpcomponents' } – Boris May 10 '16 at 15:32
  • The error comes when any other of your jar dependency have same class. Make sure you have not added support jar both as gradle and jar dependency. Check these related questions: http://stackoverflow.com/questions/33811073/guava-library-duplicate-entry-error and http://stackoverflow.com/questions/33472636/zip-zipexception-duplicate-entry-annotations-beta-class. – abielita May 11 '16 at 06:46

0 Answers0