I have used
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
in main function it is giving exception while debugging and emulator displays blank screen when it is runned without debugging
It is showing following exception ->
Exception has occurred.
PlatformException (PlatformException(channel-error, Unable to establish connection on channel., null, null))
I have updated dependencies, also added firebase core and also updated it please help me in this problem
IMAGE OF MY CODE WHERE IT IS SHOWING ERROR
output of pub outdated
[*] indicates versions that are not the latest available.
Package Name Current Upgradable Resolvable Latest
direct dependencies: all up-to-date.
dev_dependencies: all up-to-date.
transitive dependencies:
string_scanner *1.1.0 *1.1.0 *1.1.0 1.2.0
term_glyph *1.2.0 *1.2.0 *1.2.0 1.2.1
test_api *0.4.9 *0.4.9 *0.4.9 0.4.17
vector_math *2.1.2 *2.1.2 *2.1.2 2.1.4
all dependencies are up-to-date.```
3
Answers
Did you also run
flutter clean
andflutter pub get
again?Otherwise can you run
flutter pub outdated
ans share the output?1.Add to pubspec.yaml
2.Add to main.dart
Check your Firebase SDK dependencies in Project build.gradle file and Application build.gradle file
And in your app level build.grandle: