0

Multi dex files define Lcom/google/gdata/util/common/base/Escaper

I am stuck with the above error. The error ocured after i have added a dependency to the UserVoice SDK

compile 'com.uservoice:uservoice-android-sdk:+'

since i added this dependency i am unable to run my Android project.

I have read about the jarjar command could probably solve this issue. But since the dependency are .aar librararies i do not know what could be the possible solution

any help is greatly appreciated

List of other depedencies:

 compile('com.crashlytics.sdk.android:crashlytics:2.1.0@aar') {
        transitive = true;
    }
    compile('com.twitter.sdk.android:twitter:1.1.0@aar') {
        transitive = true;
    }
    compile 'com.android.support:support-v4:21.0.0'
    compile 'com.android.support:appcompat-v7:20.+'
    compile 'com.google.android.gms:play-services-wearable:+'
    compile 'com.github.manuelpeinado.fadingactionbar:fadingactionbar-abc:3.1.2'
    compile 'com.squareup.retrofit:retrofit:1.7.1'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
    compile 'com.squareup.okhttp:okhttp:2.0.0'
    compile 'com.jakewharton:butterknife:5.1.2'
    compile 'com.squareup.picasso:picasso:2.3.4'
    compile 'com.melnykov:floatingactionbutton:1.0.5'
    compile 'com.balysv.materialmenu:material-menu-abc:1.+'
    compile 'de.keyboardsurfer.android.widget:crouton:1.8.5@aar'
    compile 'com.facebook.android:facebook-android-sdk:3.20.0'
    compile 'com.joanzapata.android:android-iconify:1.0.8'
    compile 'com.squareup:otto:1.3.5'
    compile 'com.android.support:recyclerview-v7:21.+'
    compile 'com.android.support:cardview-v7:21.+'

Gradle depdencies pastebin: http://pastebin.com/0m6b8Wyi

sn0ep
  • 3,843
  • 8
  • 39
  • 63
  • You could always use the type search... I know in Eclipse its **Ctrl+Shift+T**, I think in Android Studio its **Ctrl+N**. In Eclipse it shown you also the jar origin in case of duplicates... not sure about Android Studio though – TacB0sS Nov 29 '14 at 20:57

1 Answers1

2

The problem you are having is caused by the fact that you have two dependencies that include the Escaper class. These are most likely dependencies of your dependencies so it's not obvious which one includes that class. You can be sure that com.uservoice:uservoice-android-sdk:+ includes the class Escaper as that is when your error occurs.

You can fix this problem by excluding the dependency from one of your compile dependencies. Take a look at the Gradle docs and scroll down to where it talks about "Excluding transitive dependencies". One thing to be careful of is the fact that the dependencies might be different versions but contain the same class. You should confirm that both libraries will work with the same version of the Escaper class.

Bobbake4
  • 24,509
  • 9
  • 59
  • 94
  • How can i determine which dependency is using Escaper? – sn0ep Nov 29 '14 at 19:55
  • You can use the command "gradlew dependencies" to list all the dependencies on your project. From that output you can find the one dependency you will need to exclude. This wont list the exact class just the entire dependency. You can usually Google the fully qualified class name and find out what package it is a part of. If I had to guess I would say it might be part of Guava. – Bobbake4 Nov 29 '14 at 20:10
  • I have run the depencies command but i cannot determine the problem perhaps you could take a look? check pastebin in the question. You are right about the fact that Escaper is part of guava. But none of my dependencies depend upon Guava. And i dont use it in my app either – sn0ep Nov 29 '14 at 20:16