Skip to content

DartError: MissingPluginException(No implementation found for method getLocale on channel country_codes) #55

@bhawesh2002

Description

@bhawesh2002

DartError: MissingPluginException(No implementation found for method getLocale on channel country_codes)

This exception is thrown when using final initialized = await CountryCodes.init(); in main() function of a Flutter app that is running on the web(Chrome, Firefox,.. etc)

This is how the main() function looks

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  final initialized = await CountryCodes.init();
  if (initialized) runApp(const ProviderScope(child: MainApp()));
}

Running this app on web opens a web_entrypoint.dart file which has not been created yet or is empty.

On continuing the app execution(F5 for VsCode) this is the output of DebugConsole:

Launching lib\main.dart on Chrome in debug mode...
This app is linked to the debug service: ws://127.0.0.1:51925/YHrNT1WkZsg=/ws
Debug service listening on ws://127.0.0.1:51925/YHrNT1WkZsg=/ws
Connecting to VM Service at ws://127.0.0.1:51925/YHrNT1WkZsg=/ws
Connected to the VM Service.
DartError: MissingPluginException(No implementation found for method getLocale on channel country_codes)
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3  throw_
packages/flutter/src/services/platform_channel.dart 332:7                    _invokeMethod
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50           <fn>
dart-sdk/lib/async/zone.dart 1661:54                                         runUnary
dart-sdk/lib/async/future_impl.dart 163:18                                   handleValue
dart-sdk/lib/async/future_impl.dart 861:44                                   handleValueCallback
dart-sdk/lib/async/future_impl.dart 890:13                                   _propagateToListeners
dart-sdk/lib/async/future_impl.dart 666:5                                    [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 736:7                                    callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                             _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                              _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7           <fn>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions