_apply plugin:'com.google.gms.google-services'_做什么? [英] What does _apply plugin: 'com.google.gms.google-services'_ do?
问题描述
正确添加应用插件:'com.google.gms.google-services'
做什么?如果我评论这一点,我的应用程序仍然会编译并运行。有关将Firebase添加到项目此处的详细信息。
它按照这里。它还在 firebase-core
上添加了一个编译依赖项(如果尚不存在)。该依赖关系会导致 FirebaseInitProvider 合并放入您的清单中,该清单负责初始化默认 FirebaseApp ,并在构建阶段使用它所读取的资源。
What does exactly adding apply plugin: 'com.google.gms.google-services'
do? If I comment this, my app still will compile and run. More about adding Firebase to the project here.
It reads resources out of your google-services.json file as described here. It also adds a compile dependency on firebase-core
if not already present. That dependency will cause FirebaseInitProvider to get merged into your manifest, which is responsible for initializing a default FirebaseApp at app launch with the resources it read during the build phase.
If you want to learn more about Firebase app init, read:
这篇关于_apply plugin:'com.google.gms.google-services'_做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!