Firebase database getInstance crashes app

后端 未结 3 1072
忘掉有多难
忘掉有多难 2020-12-19 11:02

When running the sample after creating google-service.json, the app crashes when trying to get database reference in SignInActivity

mDatabase = FirebaseDatab         


        
相关标签:
3条回答
  • 2020-12-19 11:30

    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'

    0 讨论(0)
  • 2020-12-19 11:36

    Download google-services.json from Project Settings in the Firebase console. My mistake was downloading it from https://developers.google.com/mobile/add.

    0 讨论(0)
  • 2020-12-19 11:48

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

    0 讨论(0)
提交回复
热议问题