I made a new app and did the steps in Decs but when I run the app, it is run correctly but still has errors on the console.
This error 6.26.0 - [Firebase/Core][I-COR000005] No app has been configured yet. show on the console just when i run the app on simulator for the first time then when i run it again it isn't shown on the console.
my console errors:
Launching lib/main.dart on iPhone 11 Pro in debug mode...
Running Xcode build...
Xcode build done. 21.1s
6.26.0 - [Firebase/Core][I-COR000005] No app has been configured yet.
Waiting for iPhone 11 Pro to report its views...
Debug service listening on ws://127.0.0.1:57659/LoVj1aW15Pg=/ws
Syncing files to device iPhone 11 Pro...
I put FirebaseSDKVersion on my podfile like this
# Uncomment this line to define a global platform for your project
platform :ios, '9.0'
# Override Firebase SDK Version
FirebaseSDKVersion = '21.1.0'
my pub file
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
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: ^0.1.3
firebase_core: ^0.5.0
firebase_auth: "^0.18.0+1"
I used the same StatefulWidget examples of Docs in my testing code ...
import 'package:flutter/material.dart';
// Import the firebase_core plugin
import 'package:firebase_core/firebase_core.dart';
void main() {
runApp(App());
}
class App extends StatefulWidget {
_AppState createState() => _AppState();
}
class _AppState extends State<App> {
// Set default `_initialized` and `_error` state to false
bool _initialized = false;
bool _error = false;
// Define an async function to initialize FlutterFire
void initializeFlutterFire() async {
try {
// Wait for Firebase to initialize and set `_initialized` state to true
await Firebase.initializeApp();
setState(() {
_initialized = true;
});
} catch (e) {
// Set `_error` state to true if Firebase initialization fails
setState(() {
_error = true;
});
}
}
@override
void initState() {
initializeFlutterFire();
super.initState();
}
@override
Widget build(BuildContext context) {
// Show error message if initialization failed
if (_error) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Text('Error 1'),
),
),
);
}
// Show a loader until FlutterFire is initialized
if (!_initialized) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Text('loading'),
),
),
);
}
return MaterialApp(
home: Scaffold(
body: Center(
child: Text(' my awesome app'),
),
),
);
}
}
