1

When trying to run my flutter application I receive the following error:

[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)

Here is an extract of my current pubspec.yaml with relevant parts:


environment:
  sdk: ">=2.17.5 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  firebase_auth: ^3.4.2
  firebase_core: ^1.19.2

  provider: ^6.0.0

  cupertino_icons: ^1.0.2
  

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_lints: ^2.0.0

flutter:

  uses-material-design: true

I am trying to login with email and password using firebase_auth but ever since I have started using firebase, my app loads to a white, blank page.

I have tried running flutter clean and reinstalling the packages using pub get but the same error persists. And when I run flutter pub outdated, it states I have no outdated dependancies.

My main.dart initial function to run the app:

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: FirebaseOptions(
        apiKey: 'AIzaSyDywKRZf...',
        appId: '1:574402216485:android:f10c99e7142f...',
        messagingSenderId: '5744022...',
        projectId: 'receiptcamp'),
  );
  runApp(MyApp());
}

I have seen some other posts (another SO issue, github issue, another SO issue) here regarding similar issues with this dependancy but none of those solutions have worked for me so far.

vimuth
  • 5,064
  • 33
  • 79
  • 116
nilekell
  • 11
  • 2
  • My friend is having the same issue when trying to build a flutter app. If he uses something I already built, it's fine, but when he tries to build it himself, he gets this issue. We've been slowly trying to see what the differences between our projects are, but we haven't found anything meaningful yet. – Sethbeastalan Jul 21 '22 at 18:48

0 Answers0