skip to Main Content
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)

I have already updated all the : firebase_core , Firebase_messaging , flutter but still have the error

I get this error only with IOS but not with android

2

Answers


  1. you have to mentioned your channel_id and channel_name if you want to push notification service.

    Changes in AndroidManiFest.xml

     <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <!-- added for firebase push notification configuration  -->
                <action android:name="FLUTTER_NOTIFICATION_CLICK" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_channel_id"
            android:value="high_importance_channel" />
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    
    Login or Signup to reply.
  2. Just run this command flutter pub outdated
    And then upgrade outdate package by running this command flutter pub upgrade outdated_package
    Then flutter clean and flutter pub get
    Don’t forget to install pod i think this will work

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search