[Android SDK] My Facebook SDK code is not compiling anymore (error: cannot find symbol)

You may have a working Android App that integrates Facebook SDK. It may also be running in production (mine is). And after a few months, you try to recompile it and…

error: cannot find symbol

Referred to these (or maybe another) Facebook SDK classes.


The reason: Your Facebook SDK version is too new.
Open your build.gradle file, and try changing

compile 'com.facebook.android:facebook-android-sdk:+’


compile 'com.facebook.android:facebook-android-sdk:3.+'

In the Facebook SDK official documentation, they encourage you to include a dependency to the latest version (4.0.0, or ‘+’, or similar), and your code was probably written for 3.X.

This issue gave me a headache diving into the code, and was as silly as that 😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s