182

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.

2 Answers 2

383

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

ViewBinding usage

3
  • 23
    For people wondering what's the exact difference its the difference in the syntax used in Kotlin and Groovy Aug 28, 2021 at 10:17
  • 5
    lol at the amount of upvotes here, IDE could be clearer Feb 28, 2022 at 12:00
  • @DanielWilson Better that developers get familiar with Gradle Mar 14, 2022 at 11:04
0

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

2
  • 1
    Yeah, that's an option too. I have nothing against Kotlin DSL in build.gradle but I think removing an equal sign is way easier and faster than migrating my build.gradle file to Kotlin DSL syntax.
    – YaMiN
    Feb 10, 2022 at 18:29
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Feb 10, 2022 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.