why is no allprojects{} in my build.gradle android studio?

Viewed 3440
2 Answers

Prior to Android Studio Arctic Fox, the Studio new-project wizard would create a project-level build.gradle file that contained an allprojects closure:

allprojects {
  repositories {
    google()
    mavenCentral()
    jcenter() // Warning: this repository is going to shut down soon
  }
}

Arctic Fox and higher do not include this. Instead, they use a slightly different system, one that is configured in settings.gradle. The default settings.gradle in an Arctic Fox project looks like:

dependencyResolutionManagement {
  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
  repositories {
    google()
    mavenCentral()
    jcenter() // Warning: this repository is going to shut down soon
  }
}
rootProject.name = "My Application"
include ':app'

The repositories closure in there serves the same basic role as the repositories closure in allprojects in the old system. So, add PayPal's maven {} content inside of the repositories closure in settings.gradle.

Check in the Setting Gradle file. this file adds the new functionality to add the dependency resource

Related