Error when adding buildFeatures in build.gradle file

I caught this error when I tried to add Jetpack to my existing app. I followed Suraj’s answer, even used the newest Kotlin gradle plugin, and couldn’t exactly figure out what was wrong. I also followed the official setup guide and it didn’t work. Everything seemed okay, but nothing helped.

Installing Android Studio 4.0 canary didn’t help either.

Turns out, it’s not enough to just include certain dependencies – you need specific versions or higher. I was using an older Android Gradle plugin: 3.5.3. Upgrading to 4.0.0-alpha07 fixed the error:

classpath 'com.android.tools.build:gradle:4.0.0-alpha07'

Make sure to check your dependencies if you’re adding Jetpack to an existing app

Leave a Comment