Android Studio 0.4.2 was working fine and today I opened it and almost everything was red and the auto-completion had stopped working. I look at the imports and AS seems to
I had the same problem, none of the solutions listed here worked. The problem was my source files where not inside the right folder.
The directory structure MUST be :
[project]\[module]\src\main\java\[yourpackage]\[yourclass.java]
Struggled with the same problem for a couple hours this morning. Building my project from command line seems to have done the trick for me.
Exact steps -
To check if it worked, look in your projects exploded-bundles folder, inspect a library and find the classes.jar. If it is expandable, then everything is going to be ok.
edit - I found after doing a clean within Android studio, it broke again. So if you have to clean, you will need to do this process again.
Be aware that the name of files and specially folders can result in this error. For instance, if you have a folder "Helpers" and the package for files in this folder is "com.whatever.helpers" it won't result in any compilation error but will cause the Android studio fail to load the symbols in that folder. One typical reason for that is when you name a folder with first capital letter, commit it on Git and later change the folder name to all lower case. The Git system won't recognize the change resulting in a discrepancy between the local and remote repositories that only the new repository clones will be affect by.
You've already gone down the list of most things that would be helpful, but you could try:
By the way, the error messages you see in the Project Structure dialog are bogus for the most part.
UPDATE:
Android Studio 0.4.3 is available in the canary update channel, and should hopefully solve most of these issues. There may be some lingering problems; if you see them in 0.4.3, let us know, and try to give us a reliable set of steps to reproduce so we can ensure we've taken care of all code paths.
I fixed this by removing the settings.gradle
from my module subproject. It's a Java Gradle project with it's own settings.gradle
file that somehow it screws it up.
Thanks to this guy: https://stackoverflow.com/a/33978721/425238
Another way is to download JDK 1.7 and change the path from Android Studio in the error message..and choose Home folder who is contained in Jdk 1.7 folder