Firebase Analytics не работает, несмотря ни на что [Пыталась уже 5 дней] ⇐ Android
-
Anonymous
Firebase Analytics не работает, несмотря ни на что [Пыталась уже 5 дней]
Just for more reference! I have empty analytics in firebase dashboard.
Firebase Messging is working fine though.
This is my dependency :
implementation platform('com.google.firebase:firebase-bom:32.7.3') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-messaging' Google Services plugin is also added in the Module level build gradle file like this :
plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' id 'com.google.gms.google-services' } Project Build Gradle :
plugins { id 'com.android.application' version '8.2.2' apply false id 'com.android.library' version '8.2.2' apply false id 'org.jetbrains.kotlin.android' version '1.9.22' apply false id 'com.google.gms.google-services' version '4.4.1' apply false } Now, In my MainAcitivty, I have initalzied it like. ( No explicit firebaseApp initialization because that is setup automatically by google services json file ) . class MainActivity : AppCompatActivity() {
private lateinit var firebaseAnalytics: FirebaseAnalytics override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(LayoutInflater.from(this@MainActivity)) setContentView(binding.root) firebaseAnalytics = FirebaseAnalytics.getInstance(this) firebaseAnalytics.setAnalyticsCollectionEnabled(true) } What would be the workaround for this?
( tried with kotlin way of initalization as stated in docs too, which is again not working --> Firebase.analytics
Источник: https://stackoverflow.com/questions/781 ... nce-5-days
Just for more reference! I have empty analytics in firebase dashboard.
Firebase Messging is working fine though.
This is my dependency :
implementation platform('com.google.firebase:firebase-bom:32.7.3') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-messaging' Google Services plugin is also added in the Module level build gradle file like this :
plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' id 'com.google.gms.google-services' } Project Build Gradle :
plugins { id 'com.android.application' version '8.2.2' apply false id 'com.android.library' version '8.2.2' apply false id 'org.jetbrains.kotlin.android' version '1.9.22' apply false id 'com.google.gms.google-services' version '4.4.1' apply false } Now, In my MainAcitivty, I have initalzied it like. ( No explicit firebaseApp initialization because that is setup automatically by google services json file ) . class MainActivity : AppCompatActivity() {
private lateinit var firebaseAnalytics: FirebaseAnalytics override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(LayoutInflater.from(this@MainActivity)) setContentView(binding.root) firebaseAnalytics = FirebaseAnalytics.getInstance(this) firebaseAnalytics.setAnalyticsCollectionEnabled(true) } What would be the workaround for this?
( tried with kotlin way of initalization as stated in docs too, which is again not working --> Firebase.analytics
Источник: https://stackoverflow.com/questions/781 ... nce-5-days
Мобильная версия