Since today, Android Studio can\'t find the AppCompat themes in styles.xml, but for example AppCompatActivity in code does get recognized. My Android Studio version
I switched support lib to version 27.1.1 and problem has been solved. Seems like some bug in 27.1.0
This is weird, I encounter this problem as below:
I solve this by below:
I encountered same problem like this.Just the difference is I was using Studio 2.2.3. This is what solved my problem:
In my project level gradle I had:
classpath 'com.android.tools.build:gradle:2.3.0-alpha2' (which was a result of updating studio)
which I replaced with: classpath 'com.android.tools.build:gradle:2.2.3'
I think you should look for a compatible classpath for your gradle configuration.
Another solution that worked for me with Android Studio 3.1.2:
delete these from build.gradle
if you have them:
'com.android.support:appcompat-v7:27.1.1'
'com.android.support:design:27.1.1'
then sync, then undo delete, then sync again.
I was having the same issue after linking Firebase to my app. Updating the build.gradle in the app module did the trick, updated to:
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-database:11.8.0'
In newer versions of Android Studio, we are asked to use 'AppCompat'. Some users uncheck that and still use the Theme.AppCompat
. That makes up this error. Same happened with me.
Solution is to add this line in your build.gradle (app).
compile 'com.android.support:appcompat-v7:26.1.0'