android - 有什么方法可以从顶级项目 gradle 中删除“classpath 'com.google.gms:google-services:4.2.0' 依赖项
问题描述
对于 firebase 设置,现在我的项目 gradle 具有 classpath 'com.google.gms:google-services:4.2.0'
.
应用程序 gradle 包含apply plugin: 'com.google.gms.google-services'
我想将firebase相关代码移动到动态模块
所以我 apply plugin: 'com.google.gms.google-services'
从app Gradle
搬到module Gradle
但classpath 'com.google.gms:google-services:4.2.0'
仍与整个项目有关。有没有办法从顶级项目 Gradle 中删除这种依赖关系?
解决方案
只需buildscript
在文件中添加块module/build.gradle
:
buildscript {
repositories {
//...
}
dependencies {
//..
classpath 'com.google.gms:google-services:4.2.0'
}
}
推荐阅读
- c++ - 强制引用类型
- c# - .NET Core 两次调用异步视图?
- reactjs - React Hook useMemo 缺少依赖项:'handleClearData'
- firebase - 我如何从 excel 文件中读取数据以颤振
- amazon-web-services - 具有预处理功能的多模型推理 AWS Sagemaker
- wpf - ViewModelLocator 没有启动
- typescript - 打字稿的引导程序(电子)
- javascript - 无法在 React Native Paper 中更改卡片标题文本的颜色
- reactjs - 如何在柏树的表格材料 ui 中检查 id 的范围?
- ansible - Ansible 任务 YAML 定义的元数据或标签