无法配置的Facebook SDK在eclipse [英] Unable to configure Facebook SDK in eclipse

查看:140
本文介绍了无法配置的Facebook SDK在eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了所有的步骤,根据上如何配置的Facebook SDK facebook的教程,并没有任何的运气,也尝试了GitHub的配置如图所示<一个href="http://stackoverflow.com/questions/4945618/android-facebook-sdk-configuration-on-eclipse">Android Eclipse的的Facebook SDK配置

I did all the steps according to the facebook tutorial on how to configure the facebook SDK, and without any luck, also tried the github configuration as shown Android Facebook SDK configuration on Eclipse

和我仍然得到在Eclipse环境中的!我所包含的Facebook给它的项目的方签字。并试图运行时,它说我有错误。

And I'm still getting in the eclipse environment a "!" sign by the side of the project I included Facebook to it. and when trying to run, it says I have errors.

如果没有Facebook的SDK我设法工作的伟大在我的项目并运行它,所以它不是一个问题,我的项目。

Without the Facebook SDK I managed to work great on my project and run it, so it is not a problem with my project..

我该怎么办?

推荐答案

我一直想把你开始使用Android版Facebook的SDK和Eclipse,不能让它的工作。在尝试不同的东西在这里是始终如一的解决方案:

I was trying to get started using Facebook's SDK for Android with Eclipse and couldn't get it to work. After trying different things here is the solution that consistently works:

1)导入(文件 - >导入 - >现有的Andr​​oid code进入工作区)就在Facebook的SDK单独的文件夹(路径\ Facebook的Andr​​oid的SDK-3.0.1)。 (不检查复制到工作场所)

1) Import (File->Import->Existing Android Code Into Workspace) just the Facebook SDK folder alone (PATH\facebook-android-sdk-3.0.1). (Do not check the copy to workplace)

2)进口(即PATH \ Facebook的Andr​​oid的SDK-3.0.1 \样本\ ProfilePictureSample)只是一个样本项目中(现在)。我将使用ProfilePictureSample作为一个例子

2) Import (i.e. PATH\facebook-android-sdk-3.0.1\samples\ProfilePictureSample) just one of the sample projects (for now). I will be using ProfilePictureSample as an example

正如你所看到的是,Eclipse抛出错误说,它不知道在ProfilePictureSampleActivity什么FragmentActivity。 FragmentActivity是android支持库的一部分。如果你看一看包装探险家,没有一个库文件夹或任何参考支持Android lirbary;它是在FacebookSDK库。我们需要告诉Eclipse来导出。

As you can see, Eclipse throws errors saying that it doesn't know what FragmentActivity in ProfilePictureSampleActivity. FragmentActivity is part of the android support library. If you take a look at the package explorer, there is not a libs folder or any reference to the android support lirbary; It is on the FacebookSDK library. We need to tell Eclipse to export it.

4)对FacebookSDK库单击右键,然后单击属性。在左边的菜单中去Java构建路径。然后订单和出口标签下选中Android的私人图书馆(您也可以点击Android的supportv4-JAR代替)。

4) Right-Click on the FacebookSDK library then click on properties. On the left menu go to Java Build Path. Then under the Order and Export tab check Android Private Libraries (you can also click on the android-supportv4-jar instead).

5)项目 - >清除

5) Project->Clean

现在由于某种原因(也许有人会细说了),示例项目也需要导出的android支持库。

Now for some reason (maybe somebody can elaborate on this), the sample project also needs to export the android support library.

6)中的样本项目(即ProfilePictureSample)单击右键,然后单击属性。在左边的菜单中去Java构建路径。然后订单和出口标签下选中Android的私人图书馆。

6) Right-Click on the sample project (i.e. ProfilePictureSample) then click on properties. On the left menu go to Java Build Path. Then under the Order and Export tab check Android Private Libraries.

7)项目 - >清除

7) Project->Clean

希望这有助于!

这篇关于无法配置的Facebook SDK在eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆