What the difference in firebase-core and firebase-analytics libraray?

北城余情 提交于 2019-12-30 17:19:15

问题


Google recently released new verison of Firebase. So I was trying to migrateto Firebase analytics.

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.


回答1:


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.

  <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



回答2:


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). 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.




回答3:


Based on google docs you don't need firebase-core anymore:

You no longer need to add the Android library com.google.firebase:firebase-core. This SDK included the Firebase SDK for Google Analytics. 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.



来源:https://stackoverflow.com/questions/37337834/what-the-difference-in-firebase-core-and-firebase-analytics-libraray

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