这个问题在这里已经有了答案:
Android Studio's project gradle file changed?
(1 个回答)
5个月前关闭。
这是我所知道的 build.gradle(Project)。
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
但我的项目的 build.gradle(Project) 就是这样。// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.1' apply false
id 'com.android.library' version '7.1.1' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我试图将 Firebase 与 Android 链接,但 build.gradle(Project) 与我知道的文件不同。我试图强行修改它,但它没有同步......
如何访问顶级 Gradle 文件?
最佳答案
对于 Android Studio Bumblebee,它们已更改 build.gradle
结构体。
您可以添加您的 buildscript
以上plugins
buildscript {
dependencies {
// Add our classpath
classpath 'com.google.gms:google-services:4.3.10'
// Add More
}
}
plugins {
id 'com.android.application' version '7.1.0' apply false
id 'com.android.library' version '7.1.0' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
关于android - 我在 build.gradle(Project) 中找不到 buildscript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71063575/