java.lang.NullPointerException:缺少ID为的必需视图:
Android Studio 3.6 在app / build.gradle中: android { viewBinding.enabled = true 这是我的xml: <?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" android:layout_width="match_parent" android:layout_height="match_parent"> <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/bluetoothBottonMainContainer" android:layout_width="0dp" android:layout_height="104dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> <View android:id="@+id/viewPointNotSelect" android:layout_width="16dp" android:layout_height="16dp" android:background="@drawable/circle_transparent" app:layout_constraintBottom_toBottomOf="@+id/separator" app:layout_constraintEnd_toStartOf="@+id/separator" app:layout_constraintTop_toTopOf="parent" /> 和另一个xml,这是不言而喻的。xml: <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/bottonContainer" android:layout_width="0dp" android:layout_height="104dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"> <include android:id="@+id/qrBottonContainer" layout="@layout/qr_bottom_container" android:layout_width="0dp" android:layout_height="wrap_content" …