2

after I added the fb library in the gradle dependences:

dependencies {
    compile 'com.mixpanel.android:mixpanel-android:4.5.2'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.facebook.android:facebook-android-sdk:3.22.0'
}

I started getting an error on gradle build:

dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;

thanks

user1796624
  • 3,665
  • 7
  • 38
  • 65

1 Answers1

1

com.facebook.android:facebook-android-sdk:3.22.0This usually occurs because of a library getting referred to twice in the dependencies.

You can run the following command to see all the dependent libraries:

gradle -q dependencies 

You may need to do something like this to prevent the support library from being included twice:

*** Updated to reflect comment

compile ('com.facebook.android:facebook-android-sdk:3.22.0'){
        exclude module: 'support-v4'
}

See this related question: Building OutsystemsNow for android on Android Studio getting dexException

Community
  • 1
  • 1
AndroidGuy
  • 3,371
  • 1
  • 19
  • 21
  • this was the answer: compile ('com.facebook.android:facebook-android-sdk:3.22.0') { exclude module: 'support-v4' } – user1796624 Jan 27 '15 at 09:00