[英]why is no allprojects{} in my build.gradle android studio?
我正在開發一個 android 應用程序,我需要將 PayPal 付款方式添加到應用程序,所以我正在使用這個
https://developer.paypal.com/docs/business/native-checkout/android/
但在這些步驟中,我應該添加這個
問題是我在我的 build.gradle 文件中找不到所有項目,如果我添加它,它會顯示一些錯誤
這就是我的 build.gradle 文件的方式
請幫助如何將其添加到我的文件中?
在 Android Studio Arctic Fox 之前,Studio 新項目向導將創建一個項目級build.gradle
文件,其中包含一個allprojects
閉包:
allprojects {
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
}
}
北極狐及更高版本不包括此。 相反,他們使用稍微不同的系統,即在settings.gradle
中配置的系統。 北極狐項目中的默認settings.gradle
如下所示:
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'
那里的存儲repositories
關閉與舊系統中allprojects
中的repositories
關閉具有相同的基本作用。 因此,在settings.gradle
的repositories
關閉內添加 PayPal 的maven {}
內容。
檢查設置 Gradle 文件。 此文件添加了添加依賴資源的新功能
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.