Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Facebook Android SDK with @AAR

As many, I am also switching to Android Studio. The Android project I have is a IntelliJ Classic project with two key dependencies: the google play services and the facebook SDK. I've swithced a project to the new Gradle-based build withthe play servies, which is rather straightforward but I fear switching the Facebook SDK library is not that easy.

I've heard and seen the usage of @aar in the dependencies. Does this dependency style exist for teh facebook SDK already? I assume there must be others out there who use the facebook sdk with a new Android Studio / Gradle based build.

It would be great to get a step-by-step instruction how to get this done.

like image 771
Sven Haiges Avatar asked Feb 15 '23 05:02

Sven Haiges


1 Answers

Facebook now publishes an AAR to the Maven Central. To use it simply add an normal dependency:

buildscript {
    repositories {
        mavenCentral()
    }
}

dependencies {
    compile('com.facebook.android:facebook-android-sdk:3.20.0')
}
like image 133
LukaCiko Avatar answered Feb 24 '23 09:02

LukaCiko