When running the sample after creating google-service.json, the app crashes when trying to get database reference in SignInActivity
mDatabase = FirebaseDatab
Changing google-services.json file didn't worked for me later i found out that i was using implementation 'com.google.firebase:firebase-analytics:17.5.0' implementation 'com.google.firebase:firebase-database:16.0.4' instead of implementation 'com.google.firebase:firebase-analytics-ktx:17.5.0' implementation 'com.google.firebase:firebase-database-ktx:19.4.0'
Download google-services.json from Project Settings in the Firebase console. My mistake was downloading it from https://developers.google.com/mobile/add.
mFirebaseDatabaseReference = database.getInstance().getReference("root-element in firebase");
When you call getReference
you need to provide a URL. If your project is bound already in Firebase with the database you have created, use the root element of the data in Firebase as the parameter to getReference()
.