Facebook 集成到 Android 中?
Posted
技术标签:
【中文标题】Facebook 集成到 Android 中?【英文标题】:Facebook integration in android? 【发布时间】:2013-02-23 21:23:48 【问题描述】:您好,我正在尝试将 Facebook 集成到我的应用程序中,因此我得到了 Integration guide 的指导
但我在第 3 步中遇到错误,当我导入时,控制台显示一些错误,例如
[2013-03-08 10:16:07 - MessagesTask] Unable to resolve target 'android-8'
[2013-03-08 10:17:00 - MessagesTask] Unable to resolve target 'android-8'
[2013-03-08 15:57:54 - ProfilePictureSample] Unable to resolve target 'android-8'
[2013-03-08 15:57:54 - BooleanOGSample] Unable to resolve target 'android-8'
[2013-03-08 15:57:54 - Hackbook] Unable to resolve target 'android-8'
[2013-03-08 15:57:55 - GraphApiSample] Unable to resolve target 'android-8'
[2013-03-08 15:57:55 - Scrumptious] Unable to resolve target 'android-8'
[2013-03-08 15:57:55 - PlacePickerSample] Unable to resolve target 'android-8'
[2013-03-08 15:57:55 - SessionLoginSample] Unable to resolve target 'android-8'
[2013-03-08 15:57:55 - FriendPickerSample] Unable to resolve target 'android-8'
[2013-03-08 15:57:55 - HelloFacebookSample] Unable to resolve target 'android-8'
[2013-03-08 15:57:55 - FacebookSDK] Unable to resolve target 'android-8'
[2013-03-08 15:57:56 - SwitchUserSample] Unable to resolve target 'android-8'
[2013-03-08 15:58:05 - ProfilePictureSample] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\samples\ProfilePictureSample\bin\jarlist.cache
[2013-03-08 15:58:07 - FacebookSDK] Unable to resolve target 'android-8'
[2013-03-08 15:58:07 - ProfilePictureSample] Unable to resolve target 'android-8'
[2013-03-08 15:58:07 - BooleanOGSample] Unable to resolve target 'android-8'
[2013-03-08 15:58:07 - Hackbook] Unable to resolve target 'android-8'
[2013-03-08 15:58:07 - GraphApiSample] Unable to resolve target 'android-8'
[2013-03-08 15:58:07 - Scrumptious] Unable to resolve target 'android-8'
[2013-03-08 15:58:07 - PlacePickerSample] Unable to resolve target 'android-8'
[2013-03-08 15:58:07 - SessionLoginSample] Unable to resolve target 'android-8'
[2013-03-08 15:58:07 - FriendPickerSample] Unable to resolve target 'android-8'
[2013-03-08 15:58:07 - HelloFacebookSample] Unable to resolve target 'android-8'
[2013-03-08 15:58:07 - SwitchUserSample] Unable to resolve target 'android-8'
[2013-03-08 15:58:07 - FacebookSDK] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\facebook\bin\jarlist.cache
[2013-03-08 15:58:07 - ProfilePictureSample] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\samples\ProfilePictureSample\bin\jarlist.cache
[2013-03-08 15:58:07 - BooleanOGSample] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\samples\BooleanOGSample\bin\jarlist.cache
[2013-03-08 15:58:07 - Hackbook] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\samples\Hackbook\bin\jarlist.cache
[2013-03-08 15:58:07 - GraphApiSample] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\samples\GraphApiSample\bin\jarlist.cache
[2013-03-08 15:58:07 - Scrumptious] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\samples\Scrumptious\bin\jarlist.cache
[2013-03-08 15:58:07 - PlacePickerSample] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\samples\PlacePickerSample\bin\jarlist.cache
[2013-03-08 15:58:07 - SessionLoginSample] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\samples\SessionLoginSample\bin\jarlist.cache
[2013-03-08 15:58:07 - FriendPickerSample] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\samples\FriendPickerSample\bin\jarlist.cache
[2013-03-08 15:58:07 - HelloFacebookSample] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\samples\HelloFacebookSample\bin\jarlist.cache
[2013-03-08 15:58:07 - SwitchUserSample] WARNING: unable to write jarlist cache file C:\Users\gtm\facebook-android-sdk-3.0\samples\SwitchUserSample\bin\jarlist.cache
那么你能帮我解决这个问题吗?
【问题讨论】:
【参考方案1】:那是因为您的 SDK 中没有 API 级别 8。右键单击项目,然后转到“属性”>“Android”并选择另一个可用的 API
【讨论】:
如果我安装并设置和构建目标怎么办?我已经多次添加和删除了 sdk,尝试了不同的版本、新的工作区、不同的计算机……在这里查看我的问题:***.com/questions/22698925/…【参考方案2】:打开Android SDK Manager并安装Android 2.2 (API 8)
【讨论】:
【参考方案3】:如果未安装 API 级别 8,则使用 Android SDK 进行安装。
如果已安装,请右键单击项目。属性>Android。选择构建路径为 Android 2.2 (API Level 8)
【讨论】:
【参考方案4】:您只需要安装 API 8。
希望对您有所帮助!
【讨论】:
你能发布你的清单 xml 吗?您是否尝试过通过 Android SDK Manager 安装 Android 2.2 API 8 ?如果您使用 android 2.2 API 8 导入了另一个项目,请检查该项目的清单! 现在没有问题 .. 我刚刚重新启动 Eclipse 然后我修复了项目属性它的工作..感谢您的回复【参考方案5】:只需将其添加到清单中
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" android:maxSdkVersion="17"/>
【讨论】:
除非绝对必要,否则请不要设置 maxSDKVersion(为什么要这样做?)以上是关于Facebook 集成到 Android 中?的主要内容,如果未能解决你的问题,请参考以下文章
如何在没有 Facebook、Twitter 等的情况下将社交功能集成到 iOS 和/或 Android 应用程序中?
已安装 Facebook 应用程序时,Android 中的 Facebook 集成不起作用
Facebook SDK 与 Android Studio 的集成