I\'ve set up my project in Android Studio to use the Square Wire library, as per this question.
Build
-> Compile Project
works fine.
I had a similar issue before, invalidating cache and restarting didn't resolve it. I just did a Gradle Sync and everything worked fine.
All the answers above didn't work for me. My problem was that i had 3 modules, with 2 of them with the same package name.
It was ok for android studio <= 3.2.1.
For android studio > 3.2.1, ressouce was red.
I solved it like this mention here (i just made differents packages name for each modules ) : Any android Studio version > 3.2.1 show red resource but still compile
My hacky fix for this -
build.gradle
filedependencies{}
build.gradle
fileTried a lot of solutions and this was the only fix for me.
I tried most of the fixes above and what actually worked was deleting all the .AndroidStudio config folders and then restarting Android Studio.
These solutions didn't help me with the same problem in Android Studio 0.5.8.
I described my answer to the same question (I guess): https://stackoverflow.com/a/23891829/534698 I just deleted ~/.AndroidStudioPreview directory (in Ubuntu). I missed all my Android Studio settings but it works.
build.gradle
Error Gone!