I\'ve set up my project in Android Studio to use the Square Wire library, as per this question.
Build
-> Compile Project
works fine.
For me deleting .gradle and .idea folder of project solved the problem.
Below steps when the Project is succesfully compiled but with unresolved classes (All classes usage will be in red color in all files)
Step 1. Delete .gradle file
Step 2. Delete .idea file
Step 3. Open new Android studio Window with some other android project on your system and close your Project with error
Step 3 . Now Open/Import the Project once again from the studio toolbar Android Studio ->File -> Open
Note: Now when you import the project the new .gradle and new .idea folders will be autogenerated with resolved dependencies by the compiler.
None of the solutions worked for me..I resorted to uninstall java from my computer, running android studio to make sure it detected the uninstall and then installing it again.
If you choose to go this way try changing the jdk path and setting the new path in the project structure. If that doesn't work, go ahead and uninstall java.
Just do this on your Android studio:
File -> Invalidate caches/Restart -> Invalidate and Restart
This worked for me. No need to clear ./gradle or ./idea folder
Solved the issue by cleaning project Build->Clean Project
I am fixed by below method
Method 1
File > Invalidate Cache/Restart > Invalidate and Restart
Method 2
1. Close current project 2. Go to your project path C://User/Android studio project/your project 3. Delete two files .gradle and .idea
1. Close Android studio 2. Go to the file C://Users/your username/ 3. Delete files .gradle , .cache ,.android, .AndroidStudio3.5