Closed CoreyCole closed 5 years ago
Since I'm no longer interested in crashlytics until I can get the database working, I'll change the tag in the title.
I've made a minimum reproduction case here: https://github.com/CoreyCole/test_firebase_app
And asked on stack overflow here: https://stackoverflow.com/questions/58528230/flutter-firebase-realtime-database-firebaseapp-with-name-default-doesnt-exist
I solved the issue. It boiled down to a documentation/error message problem:
// bad
final FirebaseApp app = FirebaseApp(name: 'DEFAULT');
// good
final FirebaseApp app = FirebaseApp(name: '[DEFAULT]');
Unfortunately, in the example app for database, we connect to a db named db2
. So I couldn't see what the correct default syntax looked like.
I've made a documentation PR to show the correct default syntax: https://github.com/FirebaseExtended/flutterfire/pull/1306
Describe the bug I'm unable to connect to my firebase realtime database and I'm unable to make a connection to the crashlytics server. I've followed the instructions for database here and crashlytics here.
Someone has a similar issue from 2 months ago on stack overflow with no posted solution. Another similar issue was solved by
flutter clean
, but unfortunately this didn't solve for me. Looks like there is also an open issue in this repo that may be related here.It looks like google-services plugin cannot find my
google-services.json
file even though I've re-downloaded and placed it in theandroid/app
directory multiple times now betweenflutter clean
builds. I've simplified the issue just to the realtime database connection and removed all the crashlyics code/config for the time being and I'm still getting the same primary error messageTo Reproduce
google-services.json
toandroid/app
android/build.gradle
andandroid/app/build.grade
using the version numbers suggested in the firebase flutter guidesmain.dart
app.dart
firebase_service.dart
root build.gradle
app build.gradle
dependencies
flutter doctor -v
What I've tried
flutter clean
/flutter packages get
builds as suggested on stack overflowcom.google.gms:google-services:4.3.2
to version4.2.0
and3.2.1
and4.0.2
as suggested on stack overflow and https://github.com/invertase/react-native-firebase/issues/1845firebase_core: 0.4.0+3
to as suggested in https://github.com/flutter/flutter/issues/34385 (as well as deleting mypubspec.lock
before runningflutter packages get
)apply plugin: 'com.google.gms.google-services'
before and after theapply plugin: 'io.fabric'
line~/.pub-cache/hosted/pub.dartlang.org/firebase_database-3.0.7/pubspec.yaml
version offirebase_core
to0.4.0+3
~/.pub-cache/
directory