eclipse Android/Facebook:项目缺少必需的库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14519205/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:51:53  来源:igfitidea点击:

Android/Facebook: Project is missing required library

androidfacebookeclipse

提问by morg

I have imported the Facebook SDK downloading it there : https://github.com/facebook/facebook-android-sdk/commits/masterand following the instructions there http://www.android10.org/index.php/articleslibraries/290-facebook-integration-in-your-android-application

我已经导入了在那里下载的 Facebook SDK:https: //github.com/facebook/facebook-android-sdk/commits/master并按照那里的说明进行操作http://www.android10.org/index.php/articleslibraries/ 290-facebook-integration-in-your-android-application

I have added FacebookSDK as a Library for my current project.

我已将 FacebookSDK 添加为我当前项目的库。

But I have errors in all the Samples imported when I import the facebook project: "Project FacebookSDK is missing required library libs/android-support-v4.jar" appears as one error for FacebookSDK project And then I have "The container 'Android Dependencies' references non existing library C:...\facebook-android-sdk-master\facebook\bin\facebooksdk.jar" for all the facebook sample projects that are in the facebook project.

但是我在导入 facebook 项目时导入的所有示例中都有错误:“项目 FacebookSDK 缺少必需的库 libs/android-support-v4.jar”作为 FacebookSDK 项目的一个错误出现然后我有“容器'Android 依赖项' 引用不存在的库 C:...\facebook-android-sdk-master\facebook\bin\facebooksdk.jar" 用于 facebook 项目中的所有 facebook 示例项目。

I tried to clear the project, to do Properties > Java Compiler > Compiler compliance level 1.6 (because 5.0 or 6.0 level was needed, not 1.7, so I downloaded jdk 1.6) tried to do Android Tools > Fix project properties

我试图清除项目,执行 Properties > Java Compiler > Compiler compliance level 1.6(因为需要 5.0 或 6.0 level,而不是 1.7,所以我下载了 jdk 1.6)尝试执行 Android Tools > Fix project properties

But I still have the same erros... Could someone tell me what I should do? Thanks

但我仍然有同样的错误......有人能告诉我我该怎么做吗?谢谢

回答by Avadhani Y

I think you have to configure Buildpath of your project. Do this as suggested below:

我认为您必须配置项目的 Buildpath 。按照以下建议执行此操作:

RightClick on your Project -> Build Path -> Configure Buildpath

Then the window be will be shown with Librariesas one of the tab. Select that tab.

然后窗口将显示Libraries为选项卡之一。选择该选项卡。

Then click Add External Jarsin the right side buttons list. Add the required Jars and select OK. Once clean and build your project.

然后Add External Jars在右侧按钮列表中单击。添加所需的罐子并选择确定。一旦清理并构建您的项目。

Hope this will help you.

希望这会帮助你。

回答by adubey

I had the same problem and as I imported FacebookSDK project and all sample projects with it as described in this getting started https://developers.facebook.com/docs/android/getting-started. Due to this none of the projects compiled as samples depends on facebooksdk.jar and FacebookSDK project doesn't build because of error sin other projects. Do this:

我遇到了同样的问题,因为我导入了 FacebookSDK 项目和所有带有它的示例项目,如本入门https://developers.facebook.com/docs/android/getting-started 中所述。因此,作为示例编译的项目均不依赖于 facebooksdk.jar,并且 FacebookSDK 项目由于其他项目的错误而无法构建。做这个:

  1. Close all the sample projects
  2. Just clean and built FacebookSDK project
  3. You should see facebooksdk.jar in bin folder
  4. Open all the other projects, clean and build
  1. 关闭所有示例项目
  2. 只需清理并构建 FacebookSDK 项目
  3. 您应该在 bin 文件夹中看到 facebooksdk.jar
  4. 打开所有其他项目,清理并构建

All error of missing library should go away

丢失库的所有错误都应该消失