skip to Main Content

Android Studio – Today I try to viewBinding but end up with error

I try to viewbind from my xml file but end up with error. I copied exactly from youtube but still error. Both ActivityMainBinding is error. Here my xml file code <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity">…

VIEW QUESTION

Android Studio – ViewBinding with Java11, AndroidStudio always shows error (but runs without any problem)

I notice that with Java8 there is no problem with viewBinding in AndroidStudio (Arctic Fox). compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } buildFeatures { viewBinding true } However, once I set compileOptions to JavaVersion.VERSION_11, AndroidStudio always falsely shows viewBiding(s) errors…

VIEW QUESTION
Back To Top
Search