Make sure you have below code in your project level gradle or settings.gradle.kts
repositories { google() mavenCentral() gradlePluginPortal() }