Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio broken after improper computer shutdown

I closed my laptop (with android studio running) to hibernate it only to find it fully shutdown later when I arrived home. And now Android Studio completely broke. I found one java file corrupted which isn't that big of a deal, I can rewrite it. But now I'm getting the "Cannot resolve symbol 'xxx'" for EVERYTHING in a project. I'm getting the error for all imports, even native Android/Java libraries. It does this for all my projects, a simple gradls sync or project rebuild didn't do anything. I'm clueless on what to do to fix this issue. http://puu.sh/c3eMs/30fcdd99a7.png

Now looking at the screenshot, workspace.xml (of the project which was opened at the time of the shutdown) also got corrupted and unfortunatelly I don't have a backup of it. Not even the github repository have it for some reason.

Any help would be greatly appreaciated to get android sudio working again. Reinstalling it would be my very last resort.

like image 344
Longi Avatar asked Dec 04 '22 05:12

Longi


2 Answers

From the screenshot, it looks like you are storing the project in Dropbox. This isn't recommended.

Try this:

After making a backup copy of the project, copy the project to another location on your hard drive. Then clear the cache and Restart Android Studio using File -> Invalidate Caches / Restart. This will give Android Studio a chance to re-index the project. Hope that helps.

like image 140
Alt-Cat Avatar answered Dec 10 '22 11:12

Alt-Cat


I have Solved my problem using steps :

  1. File->Invalidate Caches/Restart.

  2. Invalidate and Restart.

like image 32
Patriotic Avatar answered Dec 10 '22 12:12

Patriotic