Install Facebook SDK on Android Studio

Asked

Viewed 1,167 times

0

I need to use the Facebook SDK in an app of mine, but I just can’t. The app has nothing, I just created a new one. It turns out that the instructions they pass on Developers Facebook are very vague.

  • Make it clear what the problem is so someone can help.

  • I don’t know how to install the facebook SDK.

1 answer

2


According to the website in the archive /app/build.gradle, before dependencies :

repositories {
    mavenCentral()
}

On the build.Radle dependencies part put:

dependencies {
    ....
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}

After that, you have to go to the Facebook Developers website and create an Android app. Once created, the Dashboard will show the App ID. The App ID value will be copied and in the string file a string has to be created:

< string name="facebook_app_id" >(App ID)< /string >

After that, the following line has to be added to the manifest:

< meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/ >

Then just give a Sync and build on Gradle and it should work.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.