I am trying to enable View Binding on a project and I have this error:
Cannot access 'no_name_in_PSI_3d19d79d_1ba9_4cd0_b7f5_b46aa3cd5d40' which is a supertype of 'com.kevinabrioux.ping.databinding.ActivityStartingBinding'. Check your module classpath for missing or conflicting dependencies
This is where my error appear:
I have activate viewbinding in my gradle:
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.kevinabrioux.ping"
minSdkVersion 29
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
viewBinding = true
}
}
In my case this was happening because I had pasted in the <layout>
tag in my XML and I wasn't using databinding.
Removing the <layout>
tag fixed the problem.
<?xml version="1.0" encoding="utf-8"?>
<!-- Remove this layout tag and make LinearLayout the root -->
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".viewPresenter.webBrowser.WebBrowserFragment">
.
.
.
</LinearLayout>
</layout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With