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 have finally figured out what causes this issue.
Actually, you should avoid pushing .idea/libraries
folder to your repository. It creates weird stuff in Android Studio which tends to remove all downloaded libraries.
If you have commit history, just recreate all missing library files and avoid them to be committed again. Otherwise, just remove whole .idea
folder and reimport it into AS.
In my multi-module project, the problem was that version of "com.android.support:appcompat-v7" in module A was "22.0.0", but in B - "22.2.0".
Solution: make sure
1. version of common libraries is same among modules.
2. each of modules compiles without any errors (try to build each of them from CLI).
I faced similar problem but I followed following steps in my case :-
1).inside project under .idea folder open modules.xml. 2).check if there are two entries for same iml file. 3).delete one of duplicate entry and close android studio or build gradle file again.
In my case it worked. Hope it helps
Another very subtle cause:
Multi-flavor library should be compiled in specific way than a normal single-flavored. Otherwise it silently produces cannot resolve symbols error.
Multi flavor app based on multi flavor library in Android Gradle