I am getting this error in Kotlin, even when I have set viewBinding true in gradle file of app, Please help Cannot access 'androidx.viewbinding.ViewBinding' which is a supertype of 'com.example.cpapp.databinding.ActivityMainBinding'. Check your module classpath for missing or conflicting dependancies
-
can you share your build.gradle file class.Rudra Rokaya– Rudra Rokaya2022-02-16 09:53:09 +00:00Commented Feb 16, 2022 at 9:53
-
And please follow this link stackoverflow.com/questions/61775091/… this may help.Rudra Rokaya– Rudra Rokaya2022-02-16 09:54:29 +00:00Commented Feb 16, 2022 at 9:54
-
2I encountered this issue in AndroidStudio Chipmunk 2021.2.1 Patch 1. For me the issue got fixed by inValidating the caches, i.e, File > Invalidate Caches > Checked both [(FileSystem & LocalHistory), (VCS log & Indexes)] > Invalidate & restart.Subind Suresh– Subind Suresh2022-08-06 09:09:46 +00:00Commented Aug 6, 2022 at 9:09
8 Answers
it was solved just restarted my laptop and I had an update for one of the dependancies. Thanks alot for the help.
1 Comment
Add this library in app-level dependency:
implementation 'com.android.databinding:viewbinding:7.2.2'
It worked for me. thanks.
1 Comment
if you are using Android Studio 3.6.
android {
viewBinding {
enabled = true
}}
or if you are using Android Studio 4.0, viewBinding has been moved into buildFeatures
android {
buildFeatures {
viewBinding = true
}}
after that try to rebuild your project so that the binding class can be generated
then it should work properly
some times android studio gets crazy with bindings so try to invalidate cache and restart too.
