Android Studio generated a wrong ViewBinding: android.viewbinding.ViewBinding

Viewed 22

When I tried to build my project with viewBinding enabled:

buildFeatures {
   viewBinding true
}

I got this weird binding file: ActivityCameraBinding extends android.viewbinding.ViewBinding

The problem here is the file should extends androidx.viewbinding.ViewBinding. Although when I compiled and run the application, it's working, it caused the android studio shown red warning underlining ActivityCameraBinding in my project.

Is there any idea to resolve it?

1 Answers

Maybe you should migrate your project to AndroidX

Check in the gradle.properties file if android.useAndroidX and android.enableJetifier fields is true

For more information AndroidX Overview

Related