Kobojunkie
Kobojunkie

Reputation: 6553

Eclipse Hell . . . Failed to read the project description file (.project)

I think Eclipse is trying to make me miserable. A couple of hours ago, my project was working and compiling well. Suddenly that all changed. Eclipse somehow wipes out all changes I have made to my files(activity, manifest etc.) I make sure to save often but when I go to run the project, I get the error that I have a build error. I checked and there was none, so I go to close Eclipse, so I can reopen and see if the errors will go away. Instead what happens is Eclipse wipes clean all my files and I end up with a project on disk with lots of blank code files. I try to run anyway, and I get the error message below.

Failed to read the project description file (.project) for 'com.example.android.nfc.simulator.FakeTagsActivity.FakeTagsActivity'. The file has been changed on disk, and it now contains invalid information. The project will not function properly until the description file is restored to a valid state.

Anyone have an idea what in the world this is about and how I can rectify this?

Upvotes: 22

Views: 39658

Answers (10)

Molly G Hickman
Molly G Hickman

Reputation: 55

This happened to me because I had a conflict in my .project file. I opened it up in a text editor and fixed the conflict (in my case, removed from ====... to >>>branch..., as well as <<<HEAD) and then I was able to open the project in eclipse.

Upvotes: 2

D8Sasi
D8Sasi

Reputation: 79

I also got the Same Issue in Eclipse but the real problem is i removed the actual Source project folder from source location (from which eclipse is trying to take the project) to some other place hence my eclipse is unable to get web.xml file since it is not available. Now i changed my source project folder location to the path where eclipse is trying to search for. Issue Resolved for me.

Upvotes: 0

zorze
zorze

Reputation: 198

Just delete the 'servers' folder in your workspace and try again.

Upvotes: -1

cchapman
cchapman

Reputation: 3367

I was just encountering this same issue (using Zend Studio 12, which is built on Eclipse). My problem was that I was creating a project from a Remote Server, and I was just downloading everything, which also included the .project file from the old project. It wasn't showing this error until I'd closed the program and tried to open it again (which usually wasn't until the next day).

I seem to have resolved it by making sure not to download the .project when initializing the project.

Upvotes: 1

song
song

Reputation: 1

If you use git, complete the merge e.g. del the head in your androidmanifest.

Upvotes: 0

romedius
romedius

Reputation: 775

If all the files are empty, and you have no working Backup, I can't help. I would recommend to use proper version control in the future.

Use git or mercurial, they have nice UI integrations (see tortoisegit/tortoisehg).

To decouple the build process and library management from eclipse, take a look at maven or gradle, this might help you in future projects.

Upvotes: 0

john.k.doe
john.k.doe

Reputation: 7563

if you still have all of your other source (.java files, AndroidManifest.xml, resources), you might be able to get your project back by simply going to the folder containing the project, removing the .project file that you say is now empty, and then using the new project wizard to recreate the project (and .project file) for you from your existing tree of source.

from the menus, select File -> New... -> Project , and then, in the first dialog, choose Android Project from Existing Code .

if you had done anything special to the .project (reliance on specific .jar files or changes to classpath), you may have to re-do these steps after you re-create your project; but at least it should pick up the code you already have.

Upvotes: 0

matteo rulli
matteo rulli

Reputation: 1493

When Eclipse gets stuck in some obscure status, I usually find useful to recreate the .metadata folder in workspace directory. It is a drastic solution, but it usually works for me. After that you can reimport all your projects.

Upvotes: 3

Bagira
Bagira

Reputation: 2243

I would recommend to wipe out all the eclipse related configuration files(make sure you take the backup if you have manually made some changes in those) and import the project again, by following

File -> Import... -> Existing Project into Workspace

Make sure you take the backup of whole project before doing this.

Upvotes: 10

Jens Schauder
Jens Schauder

Reputation: 81988

If the .project file is a text file, so if you have it in version control you might want to copy it over from there.

Before you trying the following make a backup of your current project state.

Assuming you don't have an old copy, you can open it in a text editor and try to see if there is something obvious wrong.

If this fails, copy the source files of your project to a fresh location (without the eclipse configuration files) and import it as a new project into eclipse.

Upvotes: 0

Related Questions