Android Workspace corrupted and lost all projects data - android

I was working on android using eclipse, Last day without any reason All projects closed. When i try to open them, an error occurred, i.e ".Project file is missing".
I change the work space and copy all files to new workspace and then try to import but not work.
when i see the files inside my projects folders, all files are of size 0 kb. mean all data from all files got deleted.
Is there any way to restore that project files??? I was working on My Final Year project from the last 2 months and again goes to same start state. Please help me if there is any way to recover. Thanks

Related

How do I recover my missing 'src' folder for one of my project

Quite surprising I have recently updated one of my android app and now when I try to open it, it says:
Cannot read packageName from D:\Dell_Data\Data\Android_Projects\GK Quiz\app\src\main\AndroidManifest.xml
Neither do the explorer window shows me 'src' folder.
Note: I haven't deleted anything, and nothing is hidden. This is the first time I'm facing such a weird issue.
Any help would be appreciated!
if there is no long time , you can open the android studio and right click on the place that that deleted files where , then local history and you will find the deleted files in gray color , then you can get it again

Android build doesn't update code base or resources for target .apk on device

I have an android project to make a simple game that was proceeding normally, until a teammate decided to swap out an audio clip. I put the new .ogg file in the /res/raw folder and updated all references in the program to point to the new file. Rebuilding the program and installing it, the program still uses the old sound. This is true for multiple devices as well as virtual ones.
Since then, no change I have made to the code base has made any change to the program that gets installed.
Even when I delete the application from the device completely, and rebuild, nothing changes.
The old audio file itself has been completely been deleted from my computer, but every time I rebuild and install, the old file plays.
Where is this cached copy being stored, and how do I delete it?

Update a text file in the raw folder

I have an application reading a text file that is in the res/raw folder. It works great, but when I change this text file and try to run again the application on Eclipse (I don't need to change the raw file from this application, this I have seen that it is impossible. I just want to do it from Eclipse as I am still in the building phase of my application) and test it on my phony, the text file doesn't take into account the modifications.
The only way I found to update the file in the application is to uninstall it and re-run it.
Is it normal? Is there no way to do that?
As far as i understood, eclipse did not know it was updated, so
Right click on a project -> refresh.
If that does not help try
Project -> Clean
Yes it is a default behavior.
Assuming you dragged a file named "ABC.txt" from D drive inside the raw folder of your project. Project worspace is in E drive.
Once you drag and drop, a new file will be created in E drive inside your application folder. This file is different from the one in D drive.
Problem fixed, it was happening in the Searchable Dictionary (sample application from Android), the fix is simply to increment the database version when it's changed, and it will automatically load it again.

Changed resource image with another, recompiled, but the old image still appears

Did anyone face such a situation: you change a resource image with another image of the same name (for ex, btn.png with other btn.png), you then recompile the project and load the app into a mobile phone or emulator, but the old image still appears?
I do not know how to solve this issue. I tried uninstalling the app from the device, and installing the changed one, but new image still does not appear.
I know that I can choose a new filename and it will work, but how to force resource rebuilding?
PS. I realized that you can rebuild the project manually, so if anyone has a better solution (and faster), please let me know.
Unfortunately, it seems that in case when you replace one image with another of the same name, you have to rebuild the project as it will only trigger resources rebuilt.
I've tested different ways, and project rebuild was the only command which remapped PNG files in the resources folders.
I had faced this problem.Try doing all these this
1.Checkout all the resource folders and make sure the earlier image does not exist in any of the folders.
2.Try checking the name of the new image and check weather is same as to that of the earlier ones.
3.Try uninstalling the app after clearing all the data from the emulator or phone. Hope making all these stuff sure will solve this problem.I got it ryt by doing all these.
4.Also try runing the project after clearing the bin and gen folder in your project
.
Make sure your image in the resource folder is replaced by new image . In that case it must show new image after you do a clean build.

Android sample application

I just started working with Android apps and was trying few sample programs. I noticed an issue with the main.xml file. It happened twice today, I added few new layout views in main.xml (Using Layout and XML both), as soon as I made a modification and tried running the program, the R.java class would throw an error, also a new file called main.out.xml is getting created automatically. On top of this, when I am trying to "clean" the project, it deletes the R.java file altogether. Why is it acting this way?
This is a bug in the eclipse IDE relating to android development. I had the same problem when I first started. You need to make sure that the file that is currently being edited (i.e. active in the editor) is a java source file when you try to run the project. If any other file is active, such as your main.xml file then it ends up creating this main.out.xml that is a garbage file. To fix, just delete the garbage main.out.xml and make sure a java file is active and hit run and you are back to normal.
Try deleting that tmp file and re-cleaning the project

Categories

Resources