Search code examples
androidandroidx

Why Android Studio shows setupWithNavController not exists?


NavigationUI.setupWithNavController(bottomNavigationView, navController)

When I run the app, the code is fine, but why it keeps showing compile error like this ?

The bottom navigation I use is in com.google.android.material:material, and the bottom navigation in the param is android.support.design.widget.BottomNavigationView. I know they are the same thing, but why it complains ?

enter image description here


Solution

  • Just restart Android Studio. The lint gets confused sometimes.