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
How to Store an Integer Array in Sharedpreferences
Override Android Backbutton Behavior Only Works on the First Page with Phonegap
Progressdialog Not Shown When Asynctask.Get() Called
How to Perform Collection Group Query Using Document Id in Cloud Firestore
How to Receive Serial Data Using Android Bluetooth
Android Volley + JSONobjectrequest Caching
Design Layout for Multiple Screens
Android Device Manager Fails to Launch After Updating to MACos Big Sur 11.3
How to Apply Zoom, Drag and Rotation to an Image in Android
Why Does My App Size on Device Differ Than the APK or Play Store Size
Adb - Android - Getting the Name of the Current Activity
Fragment Over Another Fragment Issue
Programmatically Set Left Drawable in a Textview
Can't Get Values Out of Ondatachange Method
How to Loop Through Dynamic JSON String Recursively in Android
Jni and Gradle in Android Studio
How to Keep the Spaces at the End And/Or at the Beginning of a String