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.

1
  • 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. Commented Jul 6, 2016 at 22:26

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.