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
Have you tried
you can also delete the pods folder under io and try again
This is a common flutter error. You simply need to stop the application and run it again 🙂