简体   繁体   English

错误:项目FacebookSDK中的“ ._android-support-v4.jar”

[英]ERROR: “._android-support-v4.jar” in project FacebookSDK

Help needed!!!! 需要帮助!!!! Stuck for 2 weeks on this and help needed. 在这个问题上坚持了2周,需要帮助。

I've recently imported the facebook sdk for android and its projects into my workspace. 我最近将Android的facebook sdk及其项目导入了我的工作区。 It shows up errors and the problems: 它显示了错误和问题:

Archive for required library: '/home/Documents/facebook-android-sdk-3.0.2.b/facebook/libs/._android-support-v4.jar' in project 'FacebookSDK' cannot be read or is not a valid ZIP file 所需库的存档:无法读取项目'FacebookSDK'中的'/home/Documents/facebook-android-sdk-3.0.2.b/facebook/libs/._android-support-v4.jar'或它不是有效的ZIP文件

And the samples get errors along the line of: 并且样本在以下方面出错:

The container 'Android Dependencies' references non existing library '/home/Documents/facebook-android-sdk-3.0.2.b/facebook/bin/facebooksdk.jar' 容器“ Android Dependencies”引用了不存在的库“ /home/Documents/facebook-android-sdk-3.0.2.b/facebook/bin/facebooksdk.jar”

The things I have done following the other discussions without any success are 在其他讨论之后,我所做的事情没有成功

cleaned project 清理项目

set the Facebook SDK as library 将Facebook SDK设置为库

looked at the build path section and added external jar consisting of facebook/libs 查看了构建路径部分,并添加了由facebook / lib组成的外部jar

imported fb sdk like 20 times and into different folders. 将fb sdk导入20次,然后放入不同的文件夹中。

made sure my java compiler was 1.6 确保我的Java编译器是1.6

HELP would be very greatly appreciated!!!! 帮助将不胜感激!

以最新版本的android-support-v4.jar (在您的sdk环境中: sdk/extras/android/support/v4/android-support-v4.jar )替换在您的项目和库项目中不会造成冲突。

The steps to importing a library are: 导入库的步骤是:

  1. Download the library 下载资料库
  2. Place the library in the libs folder of the project. 将库放置在项目的libs文件夹中。
  3. Build the project 建立项目
  4. Do Not attempt to import the library using some import wizard. 不要尝试使用某些导入向导来导入库。

I suspect either your download was corrupted, and you need to do it again, or you put the file into the wrong directly. 我怀疑您的下载文件已损坏,需要再次执行此操作,或者直接将文件放入错误的位置。

我认为您的问题是android.support.v4版本不同,请从您的项目中取出一个,并替换Facebook sdk lib文件夹中的一个,它应该消除冲突。

As per your question, I think you are not able to compile once you add the SDK to your project. 根据您的问题,我认为将SDK添加到项目后就无法编译。 Do you get an error saying unable to run as library? 您是否收到错误消息,说无法作为库运行? If so that means you have included this as library and create your project as a library to be used further. 如果是这样,则意味着您已将该库作为库包括在内,并将您的项目创建为库以供将来使用。 It is a common mistake that I have seen many people do when they try to import a library to use and tick mark the checkbox is Library. 我看到很多人在尝试导入要使用的库并勾选复选框“库”时,这是一个常见错误。 This actually means you want this project to be treated as a library for future use. 这实际上意味着您希望将此项目视为一个库,以备将来使用。 Just try to add the SDK and do not tick mark the checkbox and this project will run fine. 只需尝试添加SDK,不要在复选框中打勾,该项目即可正常运行。 Many forums will just tell you to tick that checkbox and you will be stuck on this error for long time. 许多论坛只会告诉您勾选该复选框,并且您将长时间停留在此错误上。

For any .jar file related issues you have to make the .jars files compatible as there hashing a problem and the two jars are not compatible with each other (a version issue). 对于任何与.jar文件相关的问题,您都必须使.jars文件兼容,因为那里存在哈希问题,并且两个jar彼此不兼容(版本问题)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM