gpt4 book ai didi

java - 如何在 build.gradle 项目中添加类路径依赖项?

转载 作者:行者123 更新时间:2023-12-04 23:44:15 24 4
gpt4 key购买 nike

在 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com