Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MissingPluginException(No implementation found for method registerBackgroundCallback on channel home_widget) #39

Closed
roly151 opened this issue Sep 13, 2021 · 9 comments

Comments

@roly151
Copy link
Contributor

roly151 commented Sep 13, 2021

Fairly new to all of this. I had Android working perfectly and tried to add an ios widget. I'm using workmanager to try to update the widget in the back ground. However I am getting this error.

The error also occurs on the example app.

For me this error occurs when I try to get data from an api using the http package.

[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: MissingPluginException(No implementation found for method registerBackgroundCallback on channel home_widget)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)

[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: PlatformException(Error 8, kCLErrorDomain, The operation couldn’t be completed. (kCLErrorDomain error 8.), null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:597:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)

#2 LocalGeocoding.findAddressesFromQuery (package:geocoder/services/local.dart:18:28)

#3 _WeatherAppState.getLatLngFromLocation (package:weatherapp/main.dart:614:21)

As I'm new to this - please let me know what you need.

@peter100u
Copy link

do you have solve ? i have a error with you some

@ABausG
Copy link
Owner

ABausG commented Nov 21, 2021

Could you share a Repository a bit more code to see where this might be coming from?

@ABausG
Copy link
Owner

ABausG commented Nov 21, 2021

If I understand you correctly this error occurs on iOS and in combination with workmanager?

Did you remember to add the following to your AppDelegate?
It is required to register other Plugins (home_widget in this case) to the Workmanager so that in calls of Workmanager these plugins can be accessed

WorkmanagerPlugin.setPluginRegistrantCallback { registry in
    GeneratedPluginRegistrant.register(with: registry)
}

@Manuito83
Copy link

Hi, not sure if this is related, but I think so.

I'm using the official example app that is hosted in GitHub (v0.1.4), with no modifications at all.

On launch (iOS) I get this:

[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method registerBackgroundCallback on channel home_widget)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)

I can't update the widget (or use any of the other two buttons' functionality).

Android is working fine.

@roly151
Copy link
Contributor Author

roly151 commented Nov 28, 2021

Hi, apologies for the delay. Yes, this occurs on iOS, and in combination with work manager. I had already added the code you posted to AppDelegate.

I think I have narrowed it down to the http plugin. Stepping through the code, the error occurs when I try to use the http plugin to query an api. I've explained it a little more here: https://stackoverflow.com/questions/69200965/flutter-home-widgets-on-ios-missingpluginexceptionno-implementation-found-for

Not sure if this helps at all?

@ABausG
Copy link
Owner

ABausG commented Nov 29, 2021

There is indeed no implementation for the registerBackgroundCallback function on iOS thus far as there is no support for interactive HomeScreenWidgets on iOS. However this should be fixed with #53

@ABausG
Copy link
Owner

ABausG commented Nov 29, 2021

@Manuito83

I think your issue is unrelated to this issue however I agree that the current error you are getting is confusing (again should be fixed with #53

Your issue of not being able to update the widget might come from a setup issue with the app group id. Could you make sure you have followed the steps explained in the readme regarding the app group id?
Links to relevant sections in the readme:
https://github.com/ABausG/home_widget#add-groupid
https://github.com/ABausG/home_widget#setup

If you then still have trouble with updating the widget please let me know in #54

@Manuito83
Copy link

Thank you, you were completely right. I had a look at the README several times, but for some reason I didn't notice that the relevant setup sections for Android and iOS were expandable.

ABausG added a commit that referenced this issue Nov 30, 2021
@ABausG
Copy link
Owner

ABausG commented Dec 12, 2021

The fixed is released in https://github.com/ABausG/home_widget/releases/tag/v0.1.5

@ABausG ABausG closed this as completed Dec 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants