After renaming application package name, Android Studio displayed this error can\'t resolve symbol AppCompatActivity
Things I tried: <
This is what worked for me, strangely enough:
implementation 'com.android.support:appcompat-v7:26+'
to implementation 'com.android.support:appcompat-v7:26.0.1'
FWIW, in my case the issue occured after moving my Android Studio installation to a new machine and upgrading to AS 3.1.
Guys I know this is gonna sound stupid but I only switched my project like I had 2 projects in my system so I opened the other project when it was completely ready I clicked on open to open my actual project and it worked so just try to switch projects and re open it, this should sort out your issue.
Close your project using FILE -> CLOSE PROJECT and then Open, worked for me fixed all the issues.
If methods like
Clean project
Clean Android Studio cache
Clean Gradle cache
Re-installed IDE
File-> Invalidate cache/restart
do not work. use this method to resolve your issue.
Exit Android Studio
Navigate in your project to the .idea folder
Remove .idea folder
Restart Android Studio.
Thats it.
Only removing whole .gradle folder helped me.
I was having the same issue, but when I did Invalidate cache/restart
option it worked fine for me.
First try to clear all your build files
Build->Clean
if it doesn't work try this option
File -> Invalidate cache/Restart