1

I have an android project with strings.xml file, what contains string values. Today when i opened eclipse, all my projects were gone from package explorer. So i moved my project files from workspace to another folder and imported them in eclipse.

Afther that projects showed up, but i got few errors. Eclipse reported "Error in an XML file, aborting build.

  1. I used android tools -> fix project
  2. Then I used Project clean(eclipse reported error in xml, aborted build)
  3. Then i opened my strings.xml file to see it is empty. I opened it with IE, Chrome, Notepad, Notepadd++(showed nullnullnull) and with open office - all programs show that my xml is empty.
  4. Opened file recovery program, what scanned for previous (deleted) files, but program was unable to find differend file version.

Encoding is set UTF-8, shows file size about 300 000 bytes.

So my question: Is there any way my xml file is not empty and i can recover it ?

Thanks in advance!

5
  • sorry buddy if it is showing ur xml id empty,then it's empty.you have to create it anyhow again.No need to ask such question here. Commented Feb 14, 2012 at 6:12
  • Can you post a small part of the file from notepad here? Like 20 characters or so? Commented Feb 14, 2012 at 6:15
  • @Android Killer: You haven't had to do much in the way of data recovery by hand then? If the filesystem shows it at 300KB and Notepad++ is showing nulnullnull it suggests the first bytes are 0 causing editors to assume EOF. Replacing them with valid ASCII values with a hex editor might bring it back. I used to repair data on floppies and hard drives by hand 20 years ago doing this sort of stuff. Worth a try. Commented Feb 14, 2012 at 6:24
  • @MisterSquonk yes you are right. Commented Feb 14, 2012 at 7:04
  • thanks to all for the brainstorm, i can of course create that xml again, but it took me few hours before already, mostly why I am consurned is what if it happens again. My pc was shut down between coding sessions, so its anomaly for me. Commented Feb 14, 2012 at 9:20

2 Answers 2

0

If you're really lucky, you can see if Eclipse kept a version in its history.

Right click on the file and click on Restore from Local History...

Sign up to request clarification or add additional context in comments.

4 Comments

Eclipse kept older versions, but when i replace strings.xml file with older version Eclipse gives me and error: [2012-02-14 11:14:04 - ProjectSub] Error in an XML file: aborting build.
In that case you can navigate to the local history location and copy the files out yourself - See wiki.eclipse.org/…
Also, perhaps you might want to disable automatic builds until you find a version of strings.xml that works to avoid corrupting it again...
Thank you! Found the right version xml file under local history folder.
0

Use a hex editor to open it. If there are preceding bytes with value 0 replace them with 20 (hex value for space character). Save the file and try opening in Notepad++ again.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.