在 Gradle 更新之后,每个新项目在 中都有这种格式build.gradle (项目:”...”)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
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
}
现在如何在这里添加类路径依赖项?
最佳答案
如果您将 Firebase 添加到您的 Android 应用程序,它需要如下所示。
buildscript {
repositories {
// Check that you have the following line (if not, add it):
google() // Google's Maven repository
}
dependencies {
// Add this line
classpath 'com.google.gms:google-services:4.3.10'
}
}
plugins {
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
关于java - 如何在 build.gradle 项目中添加类路径依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71075781/