Andreas
Andreas

Reputation: 109

Android Studio - Cannot resolve com.google.firebase.analytics

I am using Android Studio and (tried) to add firebase.analytics via the menu (tools->firebase). I added the analytics function but

import com.google.firebase.analytics.FirebaseAnalytics;

results in an error since "analytics" cannot be resolved.

What is missing? Many thanks!

Upvotes: 2

Views: 6563

Answers (1)

Gomez NL
Gomez NL

Reputation: 942

Please make sure you've compiled all needed firebase libraries for analytics in your gradle app file.

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
}

Check this for more information : https://firebase.google.com/docs/analytics/android/start/

Upvotes: 1

Related Questions