简体   繁体   English

firebase-core和firebase-analytics libraray有什么区别?

[英]What the difference in firebase-core and firebase-analytics libraray?

Google recently released new verison of Firebase. Google最近发布了Firebase的新版本。 So I was trying to migrateto Firebase analytics. 因此,我试图迁移到Firebase分析。

So what is the difference between these libraries 那么这些库之间有什么区别

com.google.firebase:firebase-analytics:9.0.0

and

com.google.firebase:firebase-core:9.0.0

I found that core is for analytics too. 我发现核心也用于分析。 So whats the difference? 那有什么区别呢? Which should I use. 我应该使用哪个。

Currently there is no difference. 目前没有区别。

The firebase-core:9.0.0 has no classes and resources in the aar file and contains the firebase-analytics as you can check in the pom file. firebase-core:9.0.0在aar文件中没有任何类和资源,并且包含firebase firebase-analytics (您可以在pom文件中检入)。

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.firebase</groupId>
  <artifactId>firebase-core</artifactId>
  <version>9.0.0</version>
  <packaging>aar</packaging>
  <dependencies>
    <dependency>
      <groupId>com.google.firebase</groupId>
      <artifactId>firebase-analytics</artifactId>
      <version>9.0.0</version>
      <scope>compile</scope>
      <type>aar</type>
    </dependency>
  </dependencies>
</project>

Also in the doc you can find: 同样在文档中,您可以找到:

com.google.firebase:firebase-core:9.0.0 ->> Analytics

Apparently since June 12, 2018 declaring com.google.firebase:firebase-core is required to use any of the Firebase features ( firebase.google.com/support/release-notes/android#update_may_23_2018 ). 显然,自2018年6月12日起,需要声明com.google.firebase:firebase-core才能使用任何Firebase功能( firebase.google.com/support/release-notes/android#update_may_23_2018 )。 According to firebase.google.com/docs/android/setup#available-libraries , firebase-analytics is not even a public module, and is probably not intended to be used directly. 根据firebase.google.com/docs/android/setup#available-libraries的说明firebase-analytics甚至不是公共模块,并且可能不打算直接使用。

Based on google docs you don't need firebase-core anymore: 根据google 文档,您不再需要firebase-core:

You no longer need to add the Android library com.google.firebase:firebase-core. 您不再需要添加Android库com.google.firebase:firebase-core。 This SDK included the Firebase SDK for Google Analytics. 该SDK包括适用于Google Analytics(分析)的Firebase SDK。 Now, to use Analytics (or any of the Firebase products that require or recommend the use of Analytics), you need to explicitly add the Analytics dependency: com.google.firebase:firebase-analytics:17.2.0. 现在,要使用Google Analytics(分析)(或需要或建议使用Google Analytics(分析)的任何Firebase产品),您需要明确添加Google Analytics(分析)依赖项:com.google.firebase:firebase-analytics:17.2.0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM