“apply plugin: 'com.google.gms.google-services' ”这一行应该位于底部吗?

mle*_*kiy 3 android firebase

这行重要吗:apply plugin: 'com.google.gms.google-services' 应该位于底部吗?

它来自 firebase 页面,其中包含如何将 firebase 添加到您的 Android 应用程序的说明 它来自 firebase 页面,其中包含如何将 firebase 添加到您的 Android 应用程序的说明

Flo*_*ern 8

不再需要将其放在 build.gradle 文件的末尾。他们从最新的文档中删除了“到文件底部”的注释,并立即应用顶部的插件:

在您的模块(应用程序级)Gradle 文件(通常是 app/build.gradle)中,应用 Google Services Gradle 插件:

apply plugin: 'com.android.application'
// Add the following line:
apply plugin: 'com.google.gms.google-services'  // Google Services plugin

android {
  // ...
}
Run Code Online (Sandbox Code Playgroud)