【问题标题】:Android Studio - Cannot resolve com.google.firebase.analyticsAndroid Studio - 无法解析 com.google.firebase.analytics
【发布时间】:2018-02-13 05:22:09
【问题描述】:

我正在使用 Android Studio 并(尝试)通过菜单(工具->firebase)添加 firebase.analytics。我添加了分析功能,但

import com.google.firebase.analytics.FirebaseAnalytics;

由于无法解析“分析”而导致错误。

缺少什么? 非常感谢!

【问题讨论】:

  • 请发布您的错误日志

标签: android-studio firebase firebase-analytics


【解决方案1】:

请确保您已在 gradle 应用文件中编译了所有需要的用于分析的 firebase 库。

dependencies {
  // ...
  compile 'com.google.firebase:firebase-core:11.8.0'

  // Getting a "Could not find" error? Make sure you have
  // added the Google maven respository to your root build.gradle
}

查看更多信息:https://firebase.google.com/docs/analytics/android/start/

【讨论】:

  • 看来有了新的文档,你不需要再添加firebase-core了,只需要添加com.google.firebase:firebase-analytics就可以了
猜你喜欢
  • 1970-01-01
  • 2018-01-28
  • 2015-11-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多