Cannot Resolve Symbol 'Appcompatactivity'

Cannot resolve symbol 'AppCompatActivity'

A little addition to other answers here, for anyone having the same error while using the right lib version and the right class.

When I upgraded to

appcompat-v7:22.1.0

In which ActionBarActivity is deprecated and empty and AppCompatActivty is the way to go, due to some glitch in Android Studio, It didn't quite pick up on version change.

i.e. Even though Gradle ran without errors, the IDE itself kept saying
Cannot resolve symbol 'AppCompatActivity' (and it also wasn't available through the Ctrl+N search)

I looked into the .idea/libraries folder and noticed there's no appropriate metafile for the new version of the lib.

So, using the old-reliable File->Invalidate Caches/Restart did the trick. Always try this when you feel something is magically wrong with Android Studio.
And then Disable offline mode and sync.

Cannot resolve symbol AppCompatActivity

Thanks to everyone for the help however I had to uninstall and reinstall Android Studio and only then the errors went away.

Cannot resolve symbol 'AppCompatActivity' -- NO SOLUTION

I managed to fix this issue by uninstalling and reinstalling Android Studio (again) but this time to another location than the initial one.

Initially it was installed under D:\someFolder\Android Studio\
Installing it to the default path C:\Program Files\Android Studio\ seemed to be the only solution for me

Cannot resolve symbol AppCompatActivity - Support v7 libraries aren't recognized?

Okay, I fixed it by rebuilding it for doing a ./gradlew clean assemble for the fourth time... Android Studio is a weird thing

Cannot Resolve Symbol AppCompatActivity, Cannot Resolve Symbol ContextCompat

I had the same exact issue as you... upgraded to 3.1.2/3 and turned into a mess.

Try the following approach of deleting the libraries folder from .idea!

Cannot resolve symbol 'AppCompatActivity'



Related Topics



Leave a reply



Submit