Home > Software design >  How to fix the following errors in Android Studio?
How to fix the following errors in Android Studio?

Time:03-08

I added some libraries to Android Studio, but it gives these errors:

https://ibb.co/YcGjQV1

CodePudding user response:

Well Try Adding Google in your gradle file project level like this

 allprojects {
        repositories {
            google()
            jcenter()
        }
    }

Also mention google in repositories too

repositories {
        google()
        mavenCentral()
    }

CodePudding user response:

Try this - The repository settings that were previously in the top-level build.gradle file are now in the settings.gradle file.

As per android official document -https://developer.android.com/studio/releases/gradle-plugin#settings-gradle

pluginManagement {
  repositories {
    gradlePluginPortal()
    google()
    mavenCentral()
  }
}

dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
  repositories {
    google()
    mavenCentral()
  }
}
rootProject.name = 'App Name'
include ':app'
  • Related