I\'ve set up my project in Android Studio to use the Square Wire library, as per this question.
Build -> Compile Project works fine.
Build
Compile Project
I was still having the same problem with Android Studio v3.2.1 constantly, and sorted out the problem just removing these two sub-folders of the .idea folder (no need to delete the whole .idea folder) while a gradle sync didn't work:
.idea
./idea/caches
./idea/libraries