I added Facebook's Android SDK to my libgdx
project, in the Android-specific sub project, by following the official tutorial. I did this by adding Facebook SDK as a dependency in my build.gradle
like this:
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
...
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
}
}
This succeeded apparently since the Facebook SDK was downloaded and put into the Android project:
However, in the AndroidLauncher
class, when I try to import
Facebook SDK related classes (step 6 in the above tutorial):
import com.facebook.FacebookSdk;
I get a compilation error:
The import com.facebook cannot be resolved
What I tried so far:
What am I doing wrong?
The problem was that Eclipse cannot use aar files. To fix this, I followed the required steps to fix that, as described in the above link.
Update
After fixing this issue, my app was crashing due to a "class not found" error. So eventually I gave up on eclipse, and moved to android-studio. No errors now!