Home > Mobile >  Getting this error while connection with firebase using flutter
Getting this error while connection with firebase using flutter

Time:02-01

Exception has occurred. PlatformException (PlatformException(channel-error, Unable to establish connection on channel., null, null))

enter image description here

CodePudding user response:

try this :

Run in the terminal,

flutter pub outdated

Next, update the packages which are outdated

flutter pub upgrade outdated_package 

Then, run flutter clean next flutter pub get

CodePudding user response:

  • Step 1:

In pubspec.yaml have you added firebase_core?

  • Step 2:

If no then please goto pub.dev and find the latest version of it and add to pubspec.yaml

  • Step 4: into main.dart add this

    Future<void> main() async {
           WidgetsFlutterBinding.ensureInitialized();
           await Firebase.initializeApp();
    

    }

  • Step 3:

If yes, then run flutter clean and flutter pub get

  • Related