I have looked at Error: FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com but database url is not firebaseio.com expo and I don't believe it applies.
So...Im using flutter on the web FYI and testing in chrome.
In my main.dart I use:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
setupDependencies();
runApp(const MyApp());
}
And doing this did eliminate some errors, but not all errors.
Also, in another file I have a global var:
final DatabaseReference kDatabase = FirebaseDatabase.instance.ref();
And when trying to use kDatabase to operate on firebase, I get
Error: FIREBASE FATAL ERROR: Cannot parse Firebase url. Please use https://<YOUR
FIREBASE>.firebaseio.com
I have done dart pub get firebase ..and it says it is up to date.
My firebase_options.dart was generated automatically from the firebase website.
relevant pub spec:
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.3
dartz: ^0.10.0
get_it: ^7.2.0
freezed_annotation: ^1.1.0
cached_network_image: ^3.1.0
provider: ^6.0.1
firebase_auth: ^3.1.3
firebase_database: ^9.0.3
firebase_analytics: ^9.0.3
firebase_storage: ^10.0.5
firebase_messaging: ^11.2.3
firebase_remote_config: ^2.0.2
firebase_dynamic_links: ^4.0.2
cloud_firestore: ^3.1.4
Any ideas?