简体   繁体   中英

Why can't I add Facebook SDK on Android Studio?

I am following the Getting Started, Facebook Android SDK.

But when I am adding the repositories and the dependencies, I get the following error:

Error: Module version com.facebook.android:facebook-android-sdk:4.1.0 depends on libraries but is not a library itself.

I tried with several versions of the SDK but I can't make it work.

This is how my gradle looks:

dependencies{
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}
repositories{
mavenCentral()
}

I am using the BuildTools 22.0.1

I hope someone can orient my with this issue.

Regards

compile 'com.facebool.android:facebook-android-sdk:4.1.0' Is the facebool correct or is that an error? If that's an error then that could be your issue. Also if you can't get it to compile from a maven source try downloading a jar and putting it in your local library. Then go into the project structure and go to the module you want to add this library to and click on the dependencies tab and there is a plus icon to add a library from file.

In you build.gradle(Project:Your-Project-Name) replace jCentral() with mavenCentral() in both (allproject/repos and buildscript/repos) then sync your gradle. Hope this helps.

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