Android Kotlin – Unresolved reference: AppCompatActivity after updating to 1.5

Issue

After the update to

'androidx.appcompat:appcompat:1.5.0'

I get unresolved reference

in

class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener {

at

AppCompatActivity()

I deleted the old imports which were marked red to see if there will be import suggestions on hover over AppCompatActivity but there is nothing.

I also cleared and rebuilt the project.

How to solve this?

Solution

The problem was due to older Android Studio version, I didn’t get an update notification because there was an issue with the kotlin version.

I uninstalled/reinstalled kotlin plugin, updated Android Studio and then everything worked

Answered By – Eduard Unruh

Answer Checked By – David Marino (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *