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 this problem after upgrading to Android Studio 3.1. I solved the issue by upgrading all the components I use. So I changed the following entries in my build.gradle (app):
Upgrade SDK (from "compileSdkVersion 25" to "compileSdkVersion 26" or maybe higher when you read this note):
//compileSdkVersion 25
compileSdkVersion 26
Comment: This change forced program to download/install new sdk during next sync.
Upgrade appcompat-v7:
//implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
Upgrade firebase:
//implementation 'com.google.firebase:firebase-ads:11.4.2'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-ads:12.0.1'
In PROJECT build.gradle, upgrade google-services:
//classpath 'com.google.gms:google-services:3.1.0'
classpath 'com.google.gms:google-services:3.2.0'
Upgrade gradle (from 4.4 to 4.6). From gradle-wrapper.properties: distributionUrl=https://services.gradle.org/distributions/gradle-4.6-all.zip
After these changes, clean project, invalidate cache/restart, remove .idea/libraries content and resync (not sure about the order but ALL these activities solved the issue for me).