plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Bug]: MissingPluginException(No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info)

Open silveryTitan opened this issue 1 year ago • 3 comments

Platform

chrome web

Plugin

package_info_plus

Version

4.2.0

Flutter SDK

3.13.8

Steps to reproduce

After integrating package_info_plus, the web can be used normally when running locally. When it is published to the production environment, an error is reported MissingPluginException (No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info)

Code Sample

late String version;
void main() async {
 WidgetsFlutterBinding.ensureInitialized();
 version = (await PackageInfo.fromPlatform()).version;
runApp(
    MultiProvider(
      providers: [
        //...
      ],
      child: const MyApp(),
    ),
  );
}


dio.dart
class DioRequest {
late Dio dio;
  DioRequest() {
 dio = Dio();
dio.options = BaseOptions(
 headers: {
"version": version,
}
);
}
}

Logs

Uncaught MissingPluginException(No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info)
    at Object.d (https://.../main.dart.js:4017:19)
    at https://.../main.dart.js:67743:15
    at ax8.a (https://.../main.dart.js:5352:62)
    at ax8.$2 (https://.../main.dart.js:39807:14)
    at awo.$1 (https://.../main.dart.js:39801:21)
    at atC.aq2 (https://.../main.dart.js:40608:34)
    at atC.K_ (https://.../main.dart.js:40610:21)
    at aoW.$0 (https://.../main.dart.js:40146:11)
    at Object.wX (https://.../main.dart.js:5458:40)
    at am.ru (https://.../main.dart.js:40081:3)

Flutter Doctor

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[√] Flutter (Channel stable, 3.13.8, on Microsoft Windows [版本 10.0.22621.2715], locale zh-CN)
    • Flutter version 3.13.8 on channel stable at E:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6c4930c4ac (5 weeks ago), 2023-10-18 10:57:55 -0500
    • Engine revision 767d8c75e8
    • Dart version 3.1.4
    • DevTools version 2.25.0
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at D:\exes\androidSdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: D:\exes\androidStudio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2022.3)
    • Android Studio at D:\exes\androidStudio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.22621.2715]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 119.0.6045.160
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 118.0.2088.46

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Checklist before submitting a bug

  • [X] I searched issues in this repository and couldn't find such bug/problem
  • [X] I Google'd a solution and I couldn't find it
  • [X] I searched on StackOverflow for a solution and I couldn't find it
  • [X] I read the README.md file of the plugin
  • [X] I'm using the latest version of the plugin
  • [X] All dependencies are up to date with flutter pub upgrade
  • [X] I did a flutter clean
  • [X] I tried running the example project

silveryTitan avatar Nov 24 '23 03:11 silveryTitan

Same issue when integrating a Flutter module into an existing native iOS app using Option B - Embedding frameworks in Xcode :

MissingPluginException(No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:320)
<asynchronous suspension>
#1      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:522)
<asynchronous suspension>
#2      MethodChannelPackageInfo.getAll (package:package_info_plus_platform_interface/method_channel_package_info.dart:13)
<asynchronous suspension>
#3      PackageInfo.fromPlatform (package:package_info_plus/package_info_plus.dart:41)
<asynchronous suspension>
#4      main.<anonymous closure> (package:flutter_x_yanosik/main.dart:208)
<asynchronous suspension>
#5      Future.wait.<anonymous closure> (dart:async/future.dart:523)
<asynchronous suspension>
#6      main (package:flutter_x_yanosik/main.dart:156)
<asynchronous suspension>

My use of this plugin:

Future<void> main() async {
  // [...] - Flavor configuration
  WidgetsFlutterBinding.ensureInitialized();
  // Running the splash page:
  runApp(const SplashPage());
  // [...] - Some initialization
  await Future.wait([
      // The minimum time the splash screen should be displayed for:
      Future.delayed(const Duration(milliseconds: 4000), () {}),
      // The initialization that is going on during Splash Screen:
      () async {
        // [...] - Asynchronous initializations
        final packageInfo = await PackageInfo.fromPlatform(); // Throws the above error
        // [...] - More async initializations, that use info from `packageInfo`
      },
  ]);
  // Running the actual app after the SplashScreen:
  runApp(ActualApp());
}

dawid-niedzwiecki avatar Jan 16 '24 13:01 dawid-niedzwiecki

I I encountered this issue today after adding the package_info_plus package and release web. However, the problem disappeared after performing a flutter clean, rebuilding, and releasing again. I recently faced a similar situation with another package, where the first web build lacked the platform method.

Yiling-J avatar Feb 29 '24 10:02 Yiling-J

I can confirm what @Yiling-J wrote. I had the same error. Doing a flutter clean followed by a rebuild made the problem disappear .

j-fbriere avatar Mar 10 '24 23:03 j-fbriere

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Jun 09 '24 00:06 github-actions[bot]