Access to 'viewBinding' exceeds its access rights

AndroidAndroid StudioIntellij IdeaAndroid Gradle-PluginAndroid Viewbinding

Android Problem Overview


enter image description here

After updating Android Studio to Arctic Fox and Android Gradle plugin to 7.0.0 I'm facing this warning, I mean the app can be built successfully nonetheless of this warning but what I am missing here? What's the problem here?

According to the official View Binding reference, I'm enabling it the right way. here is my build.gradle if anyone is interested in checking.

There are some related questions but I don't think they are relevant in this situation.

Android Solutions


Solution 1 - Android

Remove equal sign. On the screenshot you use Kotlin configuration, but Groovy is needed here. See the difference:

ViewBinding usage

Solution 2 - Android

Try to rename your file 'build.gradle' to 'build.gradle.kts'. And change its content to the appropriate Kotlin DSL syntax where necessary.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionYaMiNView Question on Stackoverflow
Solution 1 - AndroidKonstantin AnnikovView Answer on Stackoverflow
Solution 2 - AndroidiZheniusView Answer on Stackoverflow