What does _apply plugin: 'com.google.gms.google-services'_ do?

你。 提交于 2019-12-13 08:57:54

问题


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.


回答1:


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:

  • How does Firebase initialize on Android?
  • Take Control of Your Firebase Init on Android


来源:https://stackoverflow.com/questions/47231761/what-does-apply-plugin-com-google-gms-google-services-do

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!