0

I have a very simple app in android studio and encountered this bizarre problem. After adding dependency to facebook sdk

compile 'com.facebook.android:facebook-android-sdk:[4,5)'

to build.gradele I always get an error:

Error:The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

I know it can be solved by using multidex but I guess facebook sdk dependency alone should not bring the number of referenced methods over the 64K limit. I will appreciate any hints on this.

Edit: Using multidex solves the problem but I would like to know if this is correct behaviour to hit the dex limit just by refferencing facebook sdk.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Using multidex solves the problem but I would like to know if this is correct behaviour to hit the dex limit just by refferencing facebook sdk. – Rafał Budziszewski Jul 06 '16 at 22:26

1 Answers1

0

Are you sure it is caused by facebook sdk?

It only has 4000 methods far from the 65k. (source: http://www.methodscount.com/?lib=com.facebook.android%3Afacebook-android-sdk%3A4.9.0)

Maybe something else is big and you only tip over the limit with facebook sdk.

jbarat
  • 2,382
  • 21
  • 23