4

I'm trying to debug a project for windows, and I'm having this problem: It runs and stops at Parse().initialize giving the error

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)
<asynchronous suspension>
#1      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:377:43)
<asynchronous suspension>
#2      MethodChannelPackageInfo.getAll (package:package_info_plus_platform_interface/method_channel_package_info.dart:13:17)
<asynchronous suspension>
#3      PackageInfo.fromPlatform (package:package_info_plus/package_info_plus.dart:36:26)
<asynchronous suspension>
#4      Parse.initialize (package:parse_server_sdk_flutter/parse_server_sdk.dart:67:39)
<asynchronous suspension>
#5      initializeParse (package:spa/main.dart:73:3)
<asynchronous suspension>
#6      main`enter code here` (package:spa/main.dart:27:3)
<asynchronous suspension>

I've tried everything, clean and pub get. When it runs for the web it works normally, it just gives an error when I go to run for windows

Ken White
  • 123,280
  • 14
  • 225
  • 444
  • 1
    Could you provide the code that is not working for you? Here is [how to create a minimal, complete, verifiable example](http://stackoverflow.com/help/mcve). – mkobuolys Mar 14 '22 at 18:41
  • 1
    Adding a new package usually doesn't work with hot-reload, have you made sure that you are doing a complete re-run of the app? – pblead26 Mar 14 '22 at 18:57
  • 1
    It runs and stops at Parse().initialize giving the error [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info) I've tried everything, clean and pub get. When it runs for the web it works normally, it just gives an error when I go to run for windows – Guilherme de Souza Mar 14 '22 at 19:39
  • 1
    I'm getting this same error after making a new Parse app. Parse app that I've been working on for months connecting to the same Parse server with the same version does NOT have an issue. Both apps are using the same version of Flutter and boilerplate code. – beansbeans Mar 14 '22 at 23:02

2 Answers2

3

I managed to solve the problem.

To solve the problem I had to add the package_info_plus_windows plugin

flutter pub add package_info_plus_windows

Then in the Parse method I added this

import 'package:package_info_plus_platform_interface/package_info_data.dart';

Future<void> initializeParse() async {
  const appId = 'xxxx';
  const clientKey = 'xxxxx';
  const serverURL = 'xxxx';
  const liveQueryUrl = 'xxxx';
  PackageInfoData packageInfoWindows = await PackageInfoWindows().getAll();

  await Parse().initialize(
    appId,
    serverURL,
    clientKey: clientKey,
    liveQueryUrl: liveQueryUrl,
    autoSendSessionId: true,
    debug: true,
    appName: packageInfoWindows.appName,
    appVersion: packageInfoWindows.version,
    appPackageName: packageInfoWindows.packageName,
  );
}
1

In my case PackageInfoData was not accessible so my solution was:

 var packageInfoWindows = await PackageInfoWindows().getAll();

  await Parse().initialize(
      keyApplicationId,
      keyParseServerUrl,
      clientKey: keyClientKey,
      autoSendSessionId: true,
    debug: true,
    appName: packageInfoWindows.appName,
    appVersion: packageInfoWindows.version,
    appPackageName: packageInfoWindows.packageName

  );
Waqas K
  • 144
  • 2
  • 12