2015-01-09 94 views
3

我一直在嘗試運行Facebook SDK示例應用程序(令人毛骨悚然,FriendPickerSample等),但無濟於事。我在作爲項目導入的Facebook SDK文件夾中有一個名爲'samples'的文件夾。然後,我可以在Android Studio窗口中運行任何示例應用程序。然而,每當我跑的應用程序之一,我會得到100個錯誤和警告12:如何在Android Studio 1.0.1上運行Facebook示例應用程序

C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\Session.java 
 
Error:(24, 30) java: package android.support.v4.app does not exist 
 
Error:(25, 34) java: package android.support.v4.content does not exist 
 
Error:(1065, 62) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.Session 
 
Error:(1090, 62) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.Session 
 
Error:(1916, 36) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.Session.AuthorizationRequest 
 
Error:(2129, 28) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.Session.OpenRequest 
 
Error:(2233, 38) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.Session.NewPermissionsRequest 
 
Error:(2255, 38) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.Session.NewPermissionsRequest 
 
Warning:(28, 22) java: android.webkit.CookieSyncManager in android.webkit has been deprecated 
 
Error:(1017, 58) java: reference to OpenRequest is ambiguous, both constructor OpenRequest(android.app.Activity) in com.facebook.Session.OpenRequest and constructor OpenRequest(Fragment) in com.facebook.Session.OpenRequest match 
 
Error:(1044, 17) java: reference to OpenRequest is ambiguous, both constructor OpenRequest(android.app.Activity) in com.facebook.Session.OpenRequest and constructor OpenRequest(Fragment) in com.facebook.Session.OpenRequest match 
 
Error:(1570, 9) java: cannot find symbol 
 
    symbol: variable LocalBroadcastManager 
 
    location: class com.facebook.Session 
 
Error:(2121, 13) java: reference to AuthorizationRequest is ambiguous, both constructor AuthorizationRequest(android.app.Activity) in com.facebook.Session.AuthorizationRequest and constructor AuthorizationRequest(Fragment) in com.facebook.Session.AuthorizationRequest match 
 
Error:(2223, 13) java: reference to AuthorizationRequest is ambiguous, both constructor AuthorizationRequest(android.app.Activity) in com.facebook.Session.AuthorizationRequest and constructor AuthorizationRequest(Fragment) in com.facebook.Session.AuthorizationRequest match 
 
Error:(2245, 13) java: reference to AuthorizationRequest is ambiguous, both constructor AuthorizationRequest(android.app.Activity) in com.facebook.Session.AuthorizationRequest and constructor AuthorizationRequest(Fragment) in com.facebook.Session.AuthorizationRequest match 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\AppEventsLogger.java 
 
Error:(24, 34) java: package android.support.v4.content does not exist 
 
Error:(26, 13) java: package bolts does not exist 
 
Error:(809, 13) java: cannot find symbol 
 
    symbol: variable LocalBroadcastManager 
 
    location: class com.facebook.AppEventsLogger 
 
Error:(1000, 30) java: cannot find symbol 
 
    symbol: variable AppLinks 
 
    location: class com.facebook.AppEventsLogger 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\widget\FacebookDialog.java 
 
Error:(27, 30) java: package android.support.v4.app does not exist 
 
Error:(320, 13) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.widget.FacebookDialog 
 
Error:(324, 47) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.widget.FacebookDialog 
 
Error:(513, 62) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.widget.FacebookDialog 
 
Error:(575, 19) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.widget.FacebookDialog.Builder<CONCRETE> 
 
Error:(629, 37) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.widget.FacebookDialog.Builder<CONCRETE> 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\widget\FacebookFragment.java 
 
Error:(21, 30) java: package android.support.v4.app does not exist 
 
Error:(42, 32) java: cannot find symbol 
 
    symbol: class Fragment 
 
Error:(48, 9) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.FacebookFragment 
 
Error:(49, 45) java: cannot find symbol 
 
    symbol: method getActivity() 
 
    location: class com.facebook.widget.FacebookFragment 
 
Error:(46, 5) java: method does not override or implement a method from a supertype 
 
Error:(59, 9) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.FacebookFragment 
 
Error:(60, 58) java: cannot find symbol 
 
    symbol: method getActivity() 
 
Error:(57, 5) java: method does not override or implement a method from a supertype 
 
Error:(65, 9) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.FacebookFragment 
 
Error:(63, 5) java: method does not override or implement a method from a supertype 
 
Error:(266, 55) java: cannot find symbol 
 
    symbol: method getActivity() 
 
    location: class com.facebook.widget.FacebookFragment 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\internal\SessionTracker.java 
 
Error:(23, 34) java: package android.support.v4.content does not exist 
 
Error:(37, 19) java: cannot find symbol 
 
    symbol: class LocalBroadcastManager 
 
    location: class com.facebook.internal.SessionTracker 
 
Error:(76, 33) java: cannot find symbol 
 
    symbol: variable LocalBroadcastManager 
 
    location: class com.facebook.internal.SessionTracker 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\widget\PickerFragment.java 
 
Error:(24, 30) java: package android.support.v4.app does not exist 
 
Error:(25, 30) java: package android.support.v4.app does not exist 
 
Error:(26, 34) java: package android.support.v4.content does not exist 
 
Error:(55, 69) java: cannot find symbol 
 
    symbol: class Fragment 
 
Error:(120, 9) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.PickerFragment<T> 
 
Error:(118, 5) java: method does not override or implement a method from a supertype 
 
Error:(133, 9) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.PickerFragment<T> 
 
Error:(131, 5) java: method does not override or implement a method from a supertype 
 
Error:(152, 5) java: method does not override or implement a method from a supertype 
 
Error:(185, 9) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.PickerFragment<T> 
 
Error:(187, 45) java: cannot find symbol 
 
    symbol: method getActivity() 
 
    location: class com.facebook.widget.PickerFragment<T> 
 
Error:(207, 41) java: cannot find symbol 
 
    symbol: method getView() 
 
    location: class com.facebook.widget.PickerFragment<T> 
 
Error:(183, 5) java: method does not override or implement a method from a supertype 
 
Error:(223, 9) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.PickerFragment<T> 
 
Error:(221, 5) java: method does not override or implement a method from a supertype 
 
Error:(234, 9) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.PickerFragment<T> 
 
Error:(232, 5) java: method does not override or implement a method from a supertype 
 
Error:(248, 9) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.PickerFragment<T> 
 
Error:(243, 5) java: method does not override or implement a method from a supertype 
 
Error:(253, 9) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.PickerFragment<T> 
 
Error:(251, 5) java: method does not override or implement a method from a supertype 
 
Error:(568, 16) java: cannot find symbol 
 
    symbol: method getString(int) 
 
    location: class com.facebook.widget.PickerFragment<T> 
 
Warning:(654, 25) java: setBackgroundDrawable(android.graphics.drawable.Drawable) in android.view.View has been deprecated 
 
Warning:(676, 31) java: setBackgroundDrawable(android.graphics.drawable.Drawable) in android.view.View has been deprecated 
 
Error:(884, 38) java: package LoaderManager does not exist 
 
Error:(883, 51) java: cannot find symbol 
 
    symbol: method getLoaderManager() 
 
    location: class com.facebook.widget.PickerFragment<T>.LoadingStrategy 
 
Error:(941, 24) java: bad operand types for binary operator '!=' 
 
    first type: com.facebook.widget.GraphObjectPagingLoader<T> 
 
    second type: <nulltype> 
 
Error:(947, 24) java: bad operand types for binary operator '!=' 
 
    first type: com.facebook.widget.GraphObjectPagingLoader<T> 
 
    second type: <nulltype> 
 
Error:(958, 51) java: cannot find symbol 
 
    symbol: method getActivity() 
 
    location: class com.facebook.widget.PickerFragment<T>.LoadingStrategy 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\widget\GraphObjectPagingLoader.java 
 
Error:(21, 34) java: package android.support.v4.content does not exist 
 
Error:(27, 62) java: cannot find symbol 
 
    symbol: class Loader 
 
Error:(108, 13) java: cannot find symbol 
 
    symbol: method isStarted() 
 
    location: class com.facebook.widget.GraphObjectPagingLoader<T> 
 
Error:(109, 13) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.GraphObjectPagingLoader<T> 
 
Error:(103, 5) java: method does not override or implement a method from a supertype 
 
Error:(119, 9) java: cannot find symbol 
 
    symbol: variable super 
 
    location: class com.facebook.widget.GraphObjectPagingLoader<T> 
 
Error:(117, 5) java: method does not override or implement a method from a supertype 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\widget\LikeView.java 
 
Error:(27, 34) java: package android.support.v4.content does not exist 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\internal\LikeActionController.java 
 
Error:(24, 34) java: package android.support.v4.content does not exist 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\internal\Utility.java 
 
Warning:(31, 22) java: android.webkit.CookieSyncManager in android.webkit has been deprecated 
 
Warning:(563, 9) java: android.webkit.CookieSyncManager in android.webkit has been deprecated 
 
Warning:(563, 41) java: android.webkit.CookieSyncManager in android.webkit has been deprecated 
 
Warning:(564, 20) java: sync() in android.webkit.CookieSyncManager has been deprecated 
 
Warning:(581, 22) java: removeExpiredCookie() in android.webkit.CookieManager has been deprecated 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\FacebookAppLinkResolver.java 
 
Error:(21, 13) java: package bolts does not exist 
 
Error:(22, 13) java: package bolts does not exist 
 
Error:(23, 13) java: package bolts does not exist 
 
Error:(24, 13) java: package bolts does not exist 
 
Error:(37, 49) java: cannot find symbol 
 
    symbol: class AppLinkResolver 
 
Error:(48, 32) java: cannot find symbol 
 
    symbol: class AppLink 
 
    location: class com.facebook.FacebookAppLinkResolver 
 
Error:(58, 12) java: cannot find symbol 
 
    symbol: class Task 
 
    location: class com.facebook.FacebookAppLinkResolver 
 
Error:(58, 17) java: cannot find symbol 
 
    symbol: class AppLink 
 
    location: class com.facebook.FacebookAppLinkResolver 
 
Error:(80, 12) java: cannot find symbol 
 
    symbol: class Task 
 
    location: class com.facebook.FacebookAppLinkResolver 
 
Error:(80, 26) java: cannot find symbol 
 
    symbol: class AppLink 
 
    location: class com.facebook.FacebookAppLinkResolver 
 
Error:(182, 27) java: package AppLink does not exist 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\UiLifecycleHelper.java 
 
Error:(25, 34) java: package android.support.v4.content does not exist 
 
Error:(56, 19) java: cannot find symbol 
 
    symbol: class LocalBroadcastManager 
 
    location: class com.facebook.UiLifecycleHelper 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\BoltsMeasurementEventListener.java 
 
Error:(8, 34) java: package android.support.v4.content does not exist 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\widget\LoginButton.java 
 
Error:(30, 30) java: package android.support.v4.app does not exist 
 
Error:(91, 13) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.widget.LoginButton 
 
Error:(630, 29) java: cannot find symbol 
 
    symbol: class Fragment 
 
    location: class com.facebook.widget.LoginButton 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\AuthorizationClient.java 
 
Warning:(654, 17) java: android.webkit.CookieSyncManager in android.webkit has been deprecated 
 
Warning:(654, 49) java: android.webkit.CookieSyncManager in android.webkit has been deprecated 
 
Warning:(655, 28) java: sync() in android.webkit.CookieSyncManager has been deprecated 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\widget\WebDialog.java 
 
Warning:(391, 30) java: setSavePassword(boolean) in android.webkit.WebSettings has been deprecated 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\android\Facebook.java 
 
Error:(308, 43) java: reference to OpenRequest is ambiguous, both constructor OpenRequest(android.app.Activity) in com.facebook.Session.OpenRequest and constructor OpenRequest(Fragment) in com.facebook.Session.OpenRequest match 
 
Error:(959, 21) java: reference to OpenRequest is ambiguous, both constructor OpenRequest(android.app.Activity) in com.facebook.Session.OpenRequest and constructor OpenRequest(Fragment) in com.facebook.Session.OpenRequest match 
 
C:\Users\Randall\Documents\AppDevelopment\SDKs\facebook-android-sdk-3.21.1\facebook\src\com\facebook\widget\PlacePickerFragment.java 
 
Error:(264, 37) java: cannot find symbol 
 
    symbol: method getActivity() 
 
    location: class com.facebook.widget.PlacePickerFragment 
 
Error:(280, 14) java: cannot find symbol 
 
    symbol: method onAttach(android.app.Activity) 
 
Error:(283, 58) java: cannot find symbol 
 
    symbol: method getActivity() 
 
    location: class com.facebook.widget.PlacePickerFragment 
 
Error:(278, 5) java: method does not override or implement a method from a supertype 
 
Error:(293, 58) java: cannot find symbol 
 
    symbol: method getActivity() 
 
    location: class com.facebook.widget.PlacePickerFragment 
 
Error:(320, 16) java: cannot find symbol 
 
    symbol: method getString(int) 
 
    location: class com.facebook.widget.PlacePickerFragment 
 
Error:(325, 64) java: cannot find symbol 
 
    symbol: method getActivity()

這似乎很奇怪我,因爲所有這些錯誤是由Facebook的SDK,例如Session.java未來。這裏是我的項目視圖的屏幕截圖:

http://i.stack.imgur.com/sxlN4.png

在此先感謝。

+0

這個錯誤@realnessray任何運氣? –

回答

2

好吧,我在這個 新安靜,但我認爲你的項目沒有support-v4庫。 它是由Facebook用於您的項目中的片段和廣播管理器的庫。 您可以使用Facebook登錄按鈕,沒有一個片段,但其建議與片段

使用它只需添加下面的行放在搖籃編譯依賴

編譯「com.android.support:support -v4:22.0 +」

我認爲它應該工作

相關問題