Facebook的第4节的SDK为Android:Eclipse的错误 [英] Facebook SDK v.4 for Android: errors on Eclipse

查看:304
本文介绍了Facebook的第4节的SDK为Android:Eclipse的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要导入Facebook的Andr​​oid SDK中的最新版本(4.0.1)到Eclipse,但我在有被正确地构建并导入为库项目所面临的问题。

I am trying to import the latest version (4.0.1) of the Facebook Android SDK into eclipse but I am facing issues in having the project being properly built and imported as a Library.

我跟着官方指南中提供的步骤(适用于Android的工作室,移植到Eclipse),并通过谷歌寻找具有如我有,但我仍然不能让它正常工作的同一问题的其他开发者。

I followed the steps (for android studio, ported to Eclipse) provided in the official guide and looked through Google for other developers having the same problems as I am having but I am still not able to have it properly working.

下面是我做的步骤:


  1. 从这里下载Facebook的SDK为Android:的https://developers.facebook.com/resources/facebook-android-sdk-current.zip

提取项目

在Eclipse中,导入现有的Andr​​oid code到工作区

In Eclipse, import existing Android code into workspace

选择文件夹脸谱,并选择所显示的唯一项目(该项目是正确导入)

Select the folder "facebook" and choose the only project that is shown (the project is properly imported)

右键点击脸谱项目,属性,Android和检查isLibrary

Right click on "facebook" project, properties, android and check "isLibrary"

清洁工程

在这一点上我仍然有注解和类不是从android.support包中发现的问题。

At this point I still have issues for annotations and classes not found from "android.support" package.

项目的设置Java编译器是1.6,minSDK是9和目标17。

Project's setting for Java compiler is "1.6", minSDK is 9 and target is 17.

我也试过向Facebook的库添加到我的主要项目,但它仍然没有工作。

I tried also to add the facebook library to my main project but it is still not working.

我试图把java 1.7编译器,但它不解决失踪班再加上它是说,能和Java 1.7编译,我需要有分钟API设置为奇巧(我不希望因为我不会能够编译4.2和4.3)。

I tried to put java 1.7 in the compiler but it is not resolving the missing classes plus it is saying that to compile with java 1.7 I need to have min API set to kitkat (which I don't want because I will not be able to compile for 4.2 and 4.3).

我手动添加androd支持罐子从Android的SDK的Manager文件夹,这部分解决了缺少的类,但有些确实存在。

I added manually the androd support jar from the SDK Manager folder of android and this resolved partially the missing classes but some did remain.

我使用的Eclipse版本:月神服务版本1(4.4.1)与JDK 1.7.0_51和最新的ADT插件(所有的Andr​​oid SDK与更新管理器组件)

I am using Eclipse Version: Luna Service Release 1 (4.4.1) with JDK 1.7.0_51 and the latest ADT Plugin (all android components updated with SDK Manager).

任何帮助是AP preciated。

Any help is appreciated.

推荐答案

我做了一些更多的测试,并发现,通过下载这两个库:

I did some more tests and find out that by downloading the two libraries:

Android的支持,v4.jar
螺栓,Android的1.1.2.jar

android-support-v4.jar bolts-android-1.1.2.jar

从GitHub的项目(<一个href=\"https://github.com/facebook/facebook-android-sdk\">https://github.com/facebook/facebook-android-sdk)没有的伎俩。

from the github project (https://github.com/facebook/facebook-android-sdk) did the trick.

因此​​,步骤如下:


  1. 下载,解压缩和进口由于Android现有code到工作区Facebook的SDK为Android的最新版本第4节

  1. Download, unpack and import as android existing code into workspace the latest v.4 version of the Facebook SDK for Android.

下载两个罐子从GitHub

Download the two jars from GitHub

设置Facebook的项目为isLibrary

Set the Facebook Project as "isLibrary"

添加两个罐子外部罐子在classpath

Add the two jars as "external jars" in the classpath

Java编译器设置为1.7

Set the java compiler to 1.7

干净重建项目

现在的错误都没有了。

这篇关于Facebook的第4节的SDK为Android:Eclipse的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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