skip to Main Content

I get this error when try to initialization to cometchat on my flutter app

final String? cometChatAppId = dotenv.env['APP_ID'];
  final String? cometChatAppRegion = dotenv.env['APP_REGION'];
  final String? authKey = dotenv.env['COMETCHAT_AUTH_KEY'];

  if (cometChatAppId != null) {
    AppSettings appSettings = (AppSettingsBuilder()
          ..subscriptionType = CometChatSubscriptionType.allUsers
          ..region = cometChatAppRegion
          ..adminHost = "" 
          ..clientHost = "" 
          ..autoEstablishSocketConnection = true)
        .build();

    await CometChat.init(cometChatAppId, appSettings,
        onSuccess: (String successMessage) {
      debugPrint("Initialization completed successfully: $successMessage");
    }, onError: (CometChatException exception) {
      debugPrint("Initialization failed with exception: ${exception.message}");
    });
  }

error:

flutter: Error: MissingPluginException(No implementation found for method init on channel cometchat) flutter: Initialization failed with exception: MissingPluginException(No implementation found for method init on channel cometchat)

I need to connect my cometchat app

2

Answers


  1. Have you tried

    1. Upgrade Flutter (flutter -upgrade)
    2. Update all your plugins
    3. flutter clean
    4. flutter run

    you can also delete the pods folder under io and try again

    Login or Signup to reply.
  2. This is a common flutter error. You simply need to stop the application and run it again 🙂

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