I have already attached the google-services.json file from my firebase after connecting my flutter app and followed all the steps but I am still receiving this error. I looked for other answers on the net but none of them helped. I tried opening the app in chrome but then I recieved this error "Error: Assertion failed: D:\…\src\firebase_core_web.dart:273 options.= null "FirebaseOptions cannot be null when creating the default app."
Are these connected? What can I do to solve these?
For your firebase_core version is seems to be sufficient to pass the FirebaseOptions once you initialize firebase in your flutter code.
Add this.
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
// Replace with actual values
options: FirebaseOptions(
apiKey: "XXX",
appId: "XXX",
messagingSenderId: "XXX",
projectId: "XXX",
),
);
runApp(MyApp());
}
you need to download this “google-services.json” file and paste it inside “android>app” section. Just like this- Then click on “Next” button. Now you need to do following changes in project-level build.gradle file.
Just like this bellow code- After updating project-level build.gradle file, Now you have add mentioned code in App-level build.gradle file
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.