Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
752 views
in Technique[技术] by (71.8m points)

java - Unable to resolve Eclipse "Archive for required library..." issue

I need help with resolving this very common Eclipse error.

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.

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:

  • 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:

Here's a screenshot of what the project build looks like:

enter image description here

Can someone please help me fix this! I really need help with this one.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I have now fixed the issue.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...