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 though it can compile and run with no problem.
I tested this with a fresh new project in AndroidStudio ArcticFox. It suggests to import the class. After imported, it says Package not found:
Is this AndroidStudio's bug, or are there any misconfiguration about Java compiler setting in my AndroidStudio?
All I did something particular was JavaVersion.VERSION_11
.
viewBinding { enabled = true } } Please check your Android Studio Version too, It must be 3.6 Canary 11+. NOTE: View binding is available in Android Studio 3.6 Canary 11+.
JVMTI error: UNKNOWN_JVMTI_ERROR To work around this issue in Android Studio 3.5, click Run to re-deploy your app and see your changes. Note: This issue ( #135172147) is fixed in Android Studio 3.6 Canary 6 and higher.
Android Studio doesn’t start after installing version 4.2 Studio tries to import previous.vmoptions and sanitize them to work with the garbage collector used by JDK 11. If that process fails, the IDE may not start for certain users who set custom VM options in the.vmoptions file.
Three Methods for Solving Android Data Binding Errors 1 View All of the Build Output#N#Android Studio has two different ways to view the build output. The default tree view... 2 Fall Back to the Old Data Binding Compiler Temporarily#N#Starting in version 3.2.1 of Android Studio, the second... 3 Invalidate Caches More ...
As google's support answered: This issue has been fixed and landed in BB canary 8. It is specific to Java 11.
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