I've been spending the past day trying to fix a corrupted eclipse workspace. I have it synched on dropbox and it's been working fine for a long time but recently there was a problem with some conflicting files in the .metadata folder and it messed up everything, my projects just stopped showing in my project explorer.
I ended up re-importing the projects into the workspace and they show fine in project view, but when I try to place them in working sets each project appears twice. If I delete one of the duplicates, the other one gets deleted as well. Anyone know how to resolve this issue? I'd rather not delete .metadata since that would erase all my settings and preferences.
If I were you, I'd start a fresh workspace. Use the preference export/import capabilities to ensure you retain all your favourite settings between workspaces.
I have never managed to save a corrupted workspace. Sometimes you've got to just let them go, like a rabid dog.
Check whether or not they are the same files shown twice. If this is the case then the solution is simple - go to 'Project Explorer' window, expand downward arrow to get the menu, then 'Project Presentation' -> 'Hierarchical'.
Related
I was working on my java final project last night, it was working fine, but then I continued today and I have sooooooo many errors, all my imports aren't working, and neither is my interfaces. I didn't change any settings, the only thing I did do was I updated intelij to the newest update, but I did that before I worked on my project yesterday. Also, all my past projects and projects I make now are broken in the same way. Does anyone know how I can fix this?
Updates sometimes mess up config files.
I had this problem on IntelliJ 2020.1 and to fix I did:
1. Go to the top navbar and click File
2. Invalidate Caches and Restart > Invalidate and Restart
If the project continues strange, you can also try the following:
1. Go to the top navbar and click File
2. Close project
3. Click on the x to delete the project
4. Using your file system, delete the .idea folder
5. Try to open your project again, using Open or Import
I was working on a project in Intellij when my laptop suddenly turned off completely(I unplugged the charger and apparently the battery loses contact if you move the computer). I'm sure I saved before unplugging. Now that I launch Intellij, I noticed several unpleasant changes:
The IDE doesn't remember recent projects; it didn't open my project straight up after I launched it as it usually did before.
Project files are all gone, all that remains is an .iml file.
The color theme changed back to white, even though I switched it to black.
Most disturbingly, local history appears to be wiped, there's nothing there save for the .iml file.
In the light of these circumstances, I have these questions:
What the hell happened? Why did all my files disappear? They were all saved, so how could they just vanish?
Is there any way to recover them or did Intellij scrapped them so thoroughly they're gone?
Right click on the project directory or folder. Go to
Local_History > Show_History
From the list of history, Right click on the change you want to recover and choose Revert
It appears that one or more of the IntelliJ project files was corrupted during the sudden power off. As a result, IntelliJ is not loading your project correctly. I would approach this by creating a new project, with the same options as your first one, and then copying the source files over from the old location.
I had no power or issues, I just left my laptop in sleep with idea running, and now everything is gone.
This issue also happened to people here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206877445-Please-help-IntelliJ-11-just-deleted-all-my-files-?page=1#community_comment_204002510
For me, I was lucky that I could still recover/undelete these files using a tool like Recuva
From one day to the next my eclipse act weird.
When I do any changes and then save them, Eclipse doesn't take them in consideration until I do a "clean project".
Before it's wasn't the case and I could even make changes while debugging.
Do you have any lead on why it does that?
I guess it's a metadata problem.
Just close Eclipse and navigate to your workspace folder. Delete the .metadata folder and restart Eclipse. The project should build as it should be :)
When you delete the .metadata folder, things like the Class Path are being validated again.
Beware:
Your Eclipse settings are gone after you delete the .metadata folder. So you have to import you project again, your theme is gone. Everything must be set again.
I've checked every site I can find for the last two days and read more that I could imagine it would take to fix this.
I had an app half made and then I couldn't get java to see a layout I had made. I hit clean like I had on many other things. Then R.java disappeared.
I deleted the layout just to be sure it wasn't the cause. R.java did not come back.
I then decided to rebuild from the previous project. About a quarter of the way through the same thing happens.
Now, half the time I start a new project R.java isn't there to begin with. And when it is there it doesn't update at all.
I have made sure to update to the newest software. I've tried "Build Project" I've tried restarting eclipse.
I have tried saving my R.java file and then when it auto deletes I replace it with the recent save. I get aapt.exe has experienced a problem and needs to close" which also happens when I try to clean the old projects to fix them.
This is wrecking my coding.
I often have problems with the R file as well. Here are some things you can try:
Delete R.java and see if it regenerates (make sure Auto build is turn on)
Turn off auto build and manually compile the project
Go to your hidden .android folder and delete debug_keystore, then restart Eclipse and rebuild. May need to restart the computer as well.
Completely uninstall and reinstall Eclipse
Then there's the other suggested answers... check your XML files for errors, make sure your classes import the correct R file instead of android.R, etc.
Do you get any specific error messages in the console?
This happens for ALL your projects?
On eclipse package explorer menu (left menu that your projects are listed) right click, select android tools,select fix project properties,
if it works, let everyone know so other people can benefit.
Check if you accidentally imported android.R, this can cause problems also. See answer from Lars here: Missing R.java file even though project cleaned
Today I see a strange behaviour of Eclipse 3.5.2 for the first time in 3 months.
First, when I run a main function, it runs a previously compiled version. Let's say I press Ctrl+F11 in the window with an open java class and existing main function. Usually it rebuilds the class and runs a new version. Today even if there was a compile mistake, it would run fine. So I guess it does not recompile the class.
Next, more strangely, if I intentionally make a mistake in the code and Eclipse underlines those lines in red, still the project Explorer does not mark them as containing errors. They remain of grey color if there were not any errors.
First I did not know how to solve this problem. I tried to reopen the project, restart Eclipse and finally reboot the OS. After the tenth attempt, after rebooting, Eclipse said that all project's files are "OUT OF SYNC with the file system". When I pressed "Refresh" - F5 on a project's header name in Project Explorer it finally marked all the files with errors as containing errors and running the main function gave the desired result.
An hour of my work passed and this happened again , with the other project. All the same. No marking of files as red, running no matter what old version of class with no compile errors.
And since Eclipse does not tell that files are out of sync, simply pressing F5 on a project cannot help.
What can you suggest?
When you select a project in the Project Explorer view and press F5, Eclipse should traverse the entire directory tree for the project checking that all files and directories all in sync. It does for me ...
The only thing I can think of that would cause this not to work is if you have file system timestamp anomalies. For example, if a file in the file system is updated but the file's last-modified shows that it was updated in the past. This kind of thing can happen if your machine's system clock is moved backwards or forwards at an inconvenient time. If you think this might have happened, try closing all projects, restarting Eclipse and doing another F5 refresh.
(I used to run into Eclipse synchronization issues a lot, but I put that down to a combination of flakey plugins and doing builds from the command line. Either F5 or Project>Clean usually works for me.)
It is also worth checking that you haven't turned off "Build automatically"; see https://stackoverflow.com/a/2818290/139985. This is not a "refresh" problem, but it would be easy to confuse it with one.
Is Build automatically on? (Menu > Project > Build automatically)
It happened to me because there was a cyclic dependency between two projects. Each project had the other on its build path.
Solution: Reimport the project
It happened to me when checking out a new file from svn in explorer. Eclipse could not find the new file for some reason.
I tried refreshing the project(F5) and Project > Clean and build the project(Project > Build All) none of these worked for me.
So I deleted the project from the Project Explorer view(Not from hard disk). Make sure you unselect "Delete project contents on disk(cannot be undone)" checkbox and save any unsaved changes before you do this.
Now reimport the project using File > Import option. That should work in most cases.
If you use gradle, or something similar, instead of reimporting a project you can just regenerate the project files (gradle eclipse for example), and then you can refresh the project. Less cumbersome than deleting and reimporting.