问题
Background: I am working on an android project with Eclipse(juno) ADT on Ubuntu 14.10 and everything was fine till I decided to work with websockets in the code, for which I included json-org.jar and WebSocket.jar, downloaded from the github project here.
/ strong>:
我现在得到这两个JAR的存档为必需库:无法读取或不是有效的ZIP文件错误。
Problem:
I now get the "Archive for required library: cannot be read or is not a valid ZIP file" error for both these JARs.
我花了无数小时尝试解决这个构建问题。到目前为止,我已经做了以下工作:
I've spent countless hours trying to fix this build issue. So far, I've done the following:
- 将JAR添加到构建路径。删除并再次添加。
- 再次下载JAR并替换以前的文件。
- 重新启动Eclipse。
- 关闭并打开相关项目。
- 清理并构建特定项目。
- 通过执行./eclipse -clean从终端。
- 将我的java编译器从1.7降低到1.5
- 创建了一个单独的Android Workspace并将该项目导入到新的。 >
- 自从我不使用Maven以来,没有做Maven清理工具。
- Add the JARs to the buildpath. Removed and Added them again.
- Downloaded the JARs again and replaced the previous files.
- Restart Eclipse.
- Close and Open the concerned project.
- Cleaned and Build the specific project.
- Cleaned the Eclipse cache by executing ./eclipse -clean from the terminal.
- Lowered my java compiler from 1.7 to 1.5
- Created a separate Android Workspace and imported the project into the new one.
- Didn't do Maven cleaning stuff since I don't use Maven.
我已经抬头,尝试失败了。我已经提到了以下相关问题:
So far, everything I've looked up and tried has failed. I have referred to the following related questions:
- Compiler error "archive for required library could not be read" - Spring Tool Suite
- archive for required library could not be read or is not a valid ZIP file
这是一个截图项目构建的样子如下:
Here's a screenshot of what the project build looks like:
有人可以帮我修复这个!我真的需要帮助这个。
Can someone please help me fix this! I really need help with this one.
推荐答案
我现在已经解决了这个问题。
I have now fixed the issue.
我认为项目中包含的一些JAR之间存在重复冲突。消除WebSocket.jar,json-org.jar和java-websocket-1.3.0.jar解决了构建问题,代码并不真的需要这些JAR依赖关系。
I think there was a duplication conflict between some of the JARs included in the project. Eliminating WebSocket.jar, json-org.jar and java-websocket-1.3.0.jar resolved the build issue and the code didn't really need these JAR dependencies anyways.
这篇关于无法解析Eclipse“存档所需库...”问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!