After renaming application package name, Android Studio displayed this error can\'t resolve symbol AppCompatActivity
Things I tried: <
When all your dependencies and SDK tools are in-line and it still is giving sync error. Add this code in your build.Gradle
and sync it:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Also like to point, before doing this I tested all tricks mentioned here. But only this worked for my Android (2.3) - Feb'17 release.
Open build.gradle file and in your dependencies and
Change file with
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
This worked for me..
Go to your build.gradle file and in your dependencies find the appcompat one, something like compile 'com.android.support:appcompat-v7:25.X.X' Change it to compile 'com.android.support:appcompat-v7:25.3.+' Then click on Sync Now on the top right of the editor. Then go back to your build.gradle and change it back to whatever it was and click Sync Now This worked for me.
This working for me, on macOS:
go to, Android Studio -> Preferences -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Platforms And download Android SDK Platform XX and Sources for Android XX. Where XX es the value of compileSdkVersion on your gradle (Module:app)
on Windows the route is: File -> Settings... -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Platforms
build.gradle
Error is no more! :)
You got error like
1.First you have to clean project after that same issue got then
2.check library minimum compile "com.android.support:appcompat-v7:22.1.0"
Check library does not use two or more times
Remove multiple time usage of library dependency