2015-04-27 51 views
-1

我一直在嘗試將Facebook SDK導入到我現有的項目中。我嘗試了下面的說明,但沒有奏效。無法將Facebook SDK導入到Android項目

  • 1:文件>導入模塊..find Facebook的Android的SDK-4.0.1然後完成
  • 2:轉到文件>項目sturucture>依賴條件標籤>模塊依賴關係選擇:實
  • 3 :SYNC項目和重建

下面是我試過的截圖。

File > Import Module

Select Parse SDK/facebook/build.gradle

Error about existing module name

Ended up changing the module name (not sure this is right thing to do)

Check dependency but Facebook is not there

enter image description here

回答

2

我看到你正在使用Gradle。爲什麼不在你的build.gradle文件中添加sdk作爲Gradle依賴項呢?

像這樣:

依賴{ 編譯 'com.facebook.android:facebook-android-sdk:4.0.1'}

+0

感謝您的回答。我是Android Studio的新手,一切都很混亂。在修改build.gradle文件之前,應該在哪裏找到SDK文件? –

+0

如果您使用Gradle,則不再需要將SDK存儲在本地。只需在那裏添加依賴關係並構建您的項目。但是,如果您想修改SDK的源代碼,那麼這種方法不適用於您。 –

相關問題