简体   繁体   中英

Cannot Import Facebook SDK to Android Project

I have been trying to import Facebook SDK to my existing project. I tried the following instruction but didn't work.

  • 1 : File > Import Module ..find facebook-android-sdk-4.0.1 then Finish
  • 2 : Go to File > Project sturucture > dependecies tab > Module Dependencies select :Facebook
  • 3 : SYNC project and Rebuild

Below is my screenshots of what I tried.

文件>导入模块

选择解析SDK / facebook / build.gradle

关于现有模块名称的错误

最终更改了模块名称(不确定这样做是否正确)

检查依赖关系,但Facebook不存在

在此处输入图片说明

I see you are using Gradle. Why not just add the sdk as a Gradle dependency, inside your build.gradle file?

Like so:

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

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