简体   繁体   English

有什么办法可以从顶级项目gradle中删除“ classpath'com.google.gms:google-services:4.2.0”依赖项

[英]Is there any way to remove "classpath 'com.google.gms:google-services:4.2.0' dependency from top level project gradle

For firebase setup now my project gradle has classpath 'com.google.gms:google-services:4.2.0' . 对于Firebase设置,现在我的项目gradle具有classpath 'com.google.gms:google-services:4.2.0'

app gradle contains apply plugin: 'com.google.gms.google-services' 应用程式gradle包含apply plugin: 'com.google.gms.google-services'

I want to move firebase related code to the dynamic module 我想将与Firebase相关的代码移至动态模块

So I moved apply plugin: 'com.google.gms.google-services' from app Gradle to module Gradle 所以我将apply plugin: 'com.google.gms.google-services'app Gradle移到了module Gradle

but classpath 'com.google.gms:google-services:4.2.0' is still related to full project. 但是classpath 'com.google.gms:google-services:4.2.0'仍与完整项目相关。 Is there any way to remove this dependency from top-level project Gradle? 有什么办法可以从顶级项目Gradle中删除此依赖项?

Just add the buildscript block inside the module/build.gradle file: 只需在module/build.gradle文件中添加buildscript块:

buildscript {
    repositories {
        //...
    }
    dependencies {
        //..
        classpath 'com.google.gms:google-services:4.2.0'
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用插件错误:“ com.google.gsm.google-services”还添加了类路径“ com.google.gms:google-services:4.2.0” - Error apply plugin: 'com.google.gsm.google-services' also added classpath 'com.google.gms:google-services:4.2.0' 将 com.google.gms:google-services:4.3.10 作为类路径添加到项目 build.gradle 文件后出现问题 - Problem downloading com.google.gms:google-services:4.3.10 after adding it as a classpath to the project build.gradle file Bitrise:无法解析配置“:classpath”的所有工件无法解析com.google.gms:google-services:4.2.0 - Bitrise: Could not resolve all artifacts for configuration ':classpath' Could not resolve com.google.gms:google-services:4.2.0 无法解析外部依赖项 com.google.gms:google-services:4.2.0,因为没有定义存储库。 安卓工作室 3.5 - Cannot resolve external dependency com.google.gms:google-services:4.2.0 because no repositories are defined. Android Studio 3.5 错误:文件 google-services.json 丢失。 (因为 com.google.gms:google-services 从 4.2.0 更新到 4.3.0) - ERROR: File google-services.json is missing. (Since com.google.gms:google-services updated from 4.2.0 to 4.3.0) 无法更新到com.google.gms:google-services:4.2.0 - Can't update to com.google.gms:google-services:4.2.0 错误:找不到com.google.gms:google-services:4.2.0 - Error: could not find com.google.gms:google-services:4.2.0 更新为实现“ com.google.android.gms:play-services-ads:15.0.2”和类路径“ com.google.gms:google-services:3.3.0”后,出现Gradle错误 - Gradle error after updating to implementation 'com.google.android.gms:play-services-ads:15.0.2' and classpath 'com.google.gms:google-services:3.3.0' 错误:(33, 0) 找不到参数的方法 classpath() [com.google.gms:google-services:3.0.1] - Error:(33, 0) Could not find method classpath() for arguments [com.google.gms:google-services:3.0.1] 找不到 arguments [com.google.gms:google-services:3.0.0] 的方法 classpath() - Could not find method classpath() for arguments [com.google.gms:google-services:3.0.0]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM