如何将 Google 服务插件应用到我的应用模块 build.gradle.kts 文件的底部?
使用 plugins {}
执行此操作文件顶部的块会发出警告,使用文件下方的相同块会导致错误,因为该块不能使用两次。
最佳答案
在 Kotlin 构建脚本中应用 Google 服务插件与在 Groovy 中应用的方式不同。
// Add this at the bottom of your file to actually apply the plugin
apply(plugin = "com.google.gms.google-services")
apply
函数使用作为 map 提供的给定选项应用插件或脚本。
关于gradle-kotlin-dsl - 如何在 Kotlin Buildscript 中应用 Google 服务插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55166895/