Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Android studio suddenly gave me error in EVERYTHING

I was working on a project in Android Studio when suddenly the power went off in my house, when it came back I opened the project almost everything gave me error messages beginning with "unused import statement" in the .java file

Also in the other project of treehouse that i did of FunFacts it agev me the same errors even though it worked before the power went off I tried cleaning and rebuilding the project but it didnt work. Even when I start a new project I dont write any code and it gives me errors Can someone help me?

Jeffrey Duarte
Jeffrey Duarte
9,706 Points

Can you post a snippet of the error log, and what changes did you make to the project from the last functional build? I would like to see if its something specific causing a spiral of errors.

1 Answer

Jeffrey Duarte
Jeffrey Duarte
9,706 Points

Under the Build Tab you should see an option to clean the project. I'm not sure why it happens, but sometimes projects get jumbled up and the system believes things are missing or not connected. If you clean and rebuild the project it should resolve the issue. Let me know if it works.

It didnt work Any other ideas of what can cause the problem?

https://drive.google.com/file/d/0B9hHD4UoJnPrYmkyWFBTcnc0VEU/view?usp=sharing I dont know if this help you what do you mean by error log? Also i didnt make any changes the power went off (so my PC also) then when it came back all the projects gave me error.

EDIT: I fixed it what I did was File--->Invalidate Caches/Restart and select Invalidate and Restart Anyway thank you very much Jeffrey.

Jeffrey Duarte
Jeffrey Duarte
9,706 Points

Glad to see you were able to figure it out. I wouldn't have been able to resolve that for you, lol. Thanks for the knowledge, hopefully I never have to use t, but now I know what to do.