Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!
We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!
Learn from Guru Rajesh Kumar and double your salary in just one year.
Error:
I’ve connected my flutter app to firebase by adding SHA1 key ( How to Get SHA-1 key in Android Studio for Firebase. ) and package name in firebase console, and also downloaded and provided google-service.json in my flutter app at android/app. But when i run app its Showing an error that i’ve not provided google-service.json file in my app. The Error Says –
E/flutter (15568): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: [core/not-initialized] Firebase has not been correctly initialized. Have you added the "google-services.json" file to the project?
E/flutter (15568):
Solution
I finally solve the problem after hours of effort.
The ‘google-services.json’ plugin should be added as a dependency inside of the android/build.gradle file as follows:
After that, activate the plugin by including the following after the line that reads “apply plugin”:
Within the /android/app/build.gradle file, put the following after “com.android.application”:
apply plugin: 'com.google.gms.google-services'