Android上的Firebase是否需要`firebase-core`? [英] Is `firebase-core` required for Firebase on Android?

查看:130
本文介绍了Android上的Firebase是否需要`firebase-core`?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,像firebase-auth这样的单个Firebase库并不曾要求我包含firebase-core.

As far as I know, individual Firebase libraries like firebase-auth didn't used to require me to include firebase-core.

但是,我最近开始了一个新的Android项目,当我尝试在没有firebase-core的情况下进行构建时,收到以下Java编译器警告:

However, I recently started a new Android project, and when I tried to build without firebase-core, I got the following Java compiler warning:

Warning: The app gradle file must have a dependency on com.google.firebase:firebase-core for Firebase services to work as intended.

Warning: The app gradle file must have a dependency on com.google.firebase:firebase-core for Firebase services to work as intended.

推荐答案

更新:2019年8月

文档现在显示是否需要特定产品SDK firebase-analytics,如果firebase-analytics推荐 ,或者根本不需要.

firebase-core在Android入门指南中不再列为必需的依赖项,并已从可用库列表.

firebase-core is no longer listed as a required dependency in the Android getting started guide and was removed from the list of available libraries.

现在将firebase-analytics添加到您的应用是入门指南中的可选.确实需要firebase-core的产品-App Messaging ,在其设置指南中列出firebase-core依赖项.

Now adding firebase-analytics to your app is optional in the getting started guide. Products that do require firebase-core, such as In-App Messaging, list the firebase-core dependency in their setup guides.

原始答案:

这是截至2018年5月23日的最新更改.根据发行说明:

This is a recent change as of May 23, 2018. Per the release notes:

您的应用gradle文件现在必须明确列出com.google.firebase:firebase-core作为Firebase服务按预期工作的依赖项.

Your app gradle file now has to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.

"Android的{X}设置"指南(示例).该步骤链接到此页面,其中包括添加firebase-core的要求.

This requirement is reflected in the "Set up {X} for Android" guides (example) in the step "Install the Firebase SDK". That step links to this page, which includes the requirement to add firebase-core.

编辑9/26/18: 查看全文

相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆