Every file of Project Unfortunately Blank while deleting .metadata folder - android

I am stuck with biggest problem now. My .metadata folder is deleted unforunately. after that i have tried to import again but all Project is going to blank. No one file has code.
What can i do? please help.

If you've deleted your (I assume Eclipse?) workspace folder and you have no way to recover it (have you tried the recycle bin/trash, deeper data recovery methods, etc.?), then your work may just be lost.
This seems like a good time to suggest integration of version control into your regular workflow. Git in particular is a pretty popular system these days.

Related

Layouts are not displayed in identical projects in Android Studio

I just copied an Android Studio project into a new folder and want Android Studio to work on the new folder from now on. Unfortunately the layout files are not correctly displayed (I only see a grey layout without any elements) and I get the message that "This project does not use the Gradle build system". I do not undestand why this error occurs. I have not added or deleted anything from the original files and projects. I invalidated the cache and restarted but the problem still exists.
Does anyone have a clue what I have to do? I'd appreciate every comment.
Do you have an idea what the problem might be and what I have to do. I'd be quite thankful for your help as I do not know what to do.

Android code overwritten by gibberish characters

Hi all. Today when I opened my eclipse some of the files in my particular project were seen as below. I havent really experienced such a problem and i dont know how to recover my overwritten code. I have tried cleaning up the project and restarting eclipse but nothing seems to work. any help is welcome. As it is very important for me to recover these files. Thanks in advance.
You can watch the local history of the file in Eclipse. If something exists there, restore it.
Right click on project:

Eclipse import deleted all XML files

I imported my project about 30 minutes ago using Android->Existing Code->MyProject.
Eclipse completely deleted every xml file. This is a huge project. I don't know what to do!!!
Try APKTool it may get your XML back for you. After that, either make backups of your code regularly or look into setting up a version control system for yourself.

Cannot find the culprit file in my android project even after expanding the main folder

The side bar in eclipse shows a red cross on the title of my project folder but there are no such signs in the directories below it in hierarchy. In which particular file does error exist? How can I know that?
Error log shows: Current file is not a match for the given config.
Sorry I just came across this now, but I've had the same error too, so I'm sure others have. There was a quite a bit easier solution than what you had to do, at least in my case. I had the exact same problem, where my main project said there was an error, so I couldn't debug or run, but there was no apparent error, other than the red X on my main folder.
In order to solve this, I simply closed the project by right-clicking on the main folder, and selected "Close Project". Then, I right-clicked on the closed project, and selected "Delete". Don't worry, this will not delete any files, it will only remove it from the workspace, and will make sure you really want to do that by asking you to confirm. Now, just click on File->Import and select "Existing Projects into Workspace". Choose your parent folder for your app that was erroring, and import it. The few times I've had the phantom error on my main app, this has fixed it each time.
Whether there is an underlying cause and this process simply refreshes something in the workspace, I'm not sure, but at this point this fix is fast enough for me to use it.
Hope this helps next time!
Project -> Clean
Closing project and opening it again fixed it for me.
formed a new workspace and formed a new project. Added each file individually. Now it shows no error.. but still can't figure out what was wrong with thr previous code..? :=(
I faced the same issue..
there was a problem in manifest xml..
the path was not set properly. there may be space in the path..
I just copied the activity tag from other project and pasted in my project and just edited the path in android:name. it worked fine..

Refresh list of drawables in Eclipse?

When I add drawable resources to my project they do not show up in the list of drawables in the Reference Chooser. I checked the R file and there are references for the files.
I have tried refreshing the project, cleaning the project, and fixing project properties and nothing seems to help. Sometimes a couple will randomly show up in there, but not all of them.
The only consistent way I can get them to show up is to restart Eclipse.
Any ideas?
Thanks
Edit: Further findings:
After some trials, I found an other inconvenient work around to he issue. Turns out when importing multiple files into the project at once, Eclipse will only add the last one imported into the reference chooser. So when I imported my images one at a time, they all show up properly!
Like I said, inconvenient considering the amount of images I have left to import, but maybe with this new information it may help nail down where the issue may be and a possible fix.
I too faced the same problem. I added an image to the res/drawable-hdpi folder, cleaned the project and was able to see the name of the image in the left pane in Eclipse. But when I tried to use this image using Reference Chooser and looked under Drawable, I didn't find it.
I simply exited from Eclipse, and started it again. It was there! Like many things in computers, problems can be resolved simply by restarting!
The only way I found to fix this is to include the generated R class itself.
I found out some new info again.
Since I am doing a port from Blackberry, almost all of my images' filenames have uppercase letters in them, so I end up importing them all and then having to rename all the images after they are imported into the project.
I tried renaming all of my images before importing them all into the project. To my delight, all of the images showed up right away in the reference chooser! So it seems there is a problem when you import files and they cause errors with your project and allowing all of them to show up in the reference chooser.
So if you have to rename files, do it before import!
I'm just not entirely sure that this is the only cause for this issue but it has solved the problem for me.

Categories

Resources