Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

archive for required library could not be read or is not a valid ZIP file

Before coming to the problem let me explain what I did that has landed me in the problem.

  1. I created an account on github and made a repository named Android.
  2. Then I installed github client in my windows 7.
  3. Then I opened this client, provided my authentication and cloned the repository to a local directory C:\Users\Aniket\Documents\GitHub\Android(This folder has the .git folder in it).
  4. Then I went to my Eclipse ADT and installed EGit plugin as described here. Also I
  5. Then in Eclipse I right click on my project TicTacToe go to Team->Share Project and provide my repository path i.e C:\Users\Aniket\Documents\GitHub\Android.
  6. My Project was added to the local repository and in my github client it shows me all option to commit file in the actual repository on the github site.
  7. But my project is suddenly showing error with a red '!' sign on it.

    Description --> Archive for required library: 'C:/Users/Aniket/AndroidWorkspace/TicTacToe /libs/android-support-v4.jar' in project 'TicTacToe' cannot be read or is not a valid ZIP file

    Resource --> TicTacToe

    Path Location --> Build path

    Type --> Build Path Problem

Note : the Error was a single line displayed in error console on Eclipse. I just split it up for readability.

Even after detaching repository it shows that error.

Has anyone encountered this scenario before. What is the solution or workaround? I googled and first few links suggest it is an Eclipse bug. Please suggest what can be done to bring my project back to executable state?

like image 498
Aniket Thakur Avatar asked Oct 22 '13 18:10

Aniket Thakur


3 Answers

It is an Eclipse bug. I have faced the similar problem several times. closing and reopening the project works sometime. if it doesn't work try restarting Eclipse.

like image 157
rachit Avatar answered Oct 13 '22 23:10

rachit


I've seen the same issue. I removed that jar file, and then rightclick on the project, select maven, and do "update project...". The jar was downloaded again, and the problem was gone.

like image 22
volatilevar Avatar answered Oct 13 '22 22:10

volatilevar


There is other case to display error Archive for required library

Right click on project and open --> project project properties --> java build path --> Android private libs

if there are two jar files with same name then remove one from libs.

jar file may the hidden some times then open you libs folder in window and check if any hidden files are exist Organize --> folders and search options --> view --> check show hidden files and Delete the hidden jar file , The same cass delete if hidden java fies exist in src and packages if any

like image 10
Sandeep P Avatar answered Oct 13 '22 23:10

Sandeep P