简体   繁体   中英

Enabling Facebook SDK in an Android Project

I specify the Facebook SDK as a remote dependency in my build.gradle file, however I've also had to import the actual SDK files into my Android project. Isn't that redundant? Or does the specification of the remote dependency and the import of the Facebook SDK files fulfill two different requirements.

If I want to update the SDK version my app uses, is it necessary to update the actual SDK files I previously imported into my project? Or can I just update my dependency in the build.gradle file?

Open your your_app | build.gradle, and add the compile dependency

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

Build your project. Now you can import com.facebook.FacebookSdk into your app.

It's all what you need to use de Facebook Sdk. If you want to update facebook sdk version just change de compile dependency and sync gradle.

For more information visit Facebook Docs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM