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

Example app: on IOS: uncaught exception 'NSInternalInconsistencyException', reason: 'failed to set registerPlugins' #38

Open
AlexanderUsselmann opened this issue Feb 14, 2020 · 4 comments

Comments

@AlexanderUsselmann
Copy link

AlexanderUsselmann commented Feb 14, 2020

Running the example code in IOS result in a crash on startup with the following error message:
flutter: Initializing..

*** Assertion failure in -[GeofencingPlugin startGeofencingService:], /Users/xxx/flutter/.pub-cache/hosted/pub.dartlang.org/geofencing-0.0.1/ios/Classes/GeofencingPlugin.m:164

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'failed to set registerPlugins'

using pubspec.yaml entry:

geofencing: ^0.0.1

I would be very pleased about some help or a idea for a possible solution

@braysonjohn148
Copy link

So for those who couldn't solve this, running on C not swift, your AppDelegate.m

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#include "FlutterDownloaderPlugin.h"

@implementation AppDelegate

void registerPlugins(NSObject* registry) {
// [GeneratedPluginRegistrant registerWithRegistry:registry];
[FlutterDownloaderPlugin registerWithRegistrar:[registry registrarForPlugin:@"vn.hunghd.flutter_downloader"]];
}

  • (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [GeneratedPluginRegistrant registerWithRegistry:self];
    [FlutterDownloaderPlugin setPluginRegistrantCallback:registerPlugins];
    // Override point for customization after application launch.
    return [super application:application didFinishLaunchingWithOptions:launchOptions];
    }

@EnD

copy that and paste it

@bkonyi
Copy link
Owner

bkonyi commented Apr 13, 2020

To be clear, geofencing ^0.0.1 is not up to date with this repository. I wasn't intending on officially publishing this plugin as the Flutter plugins team didn't have the bandwidth to support it, so it appears that some individuals decided to publish it themselves. If you want to use this plugin as-is, your best bet is to pull it in with a local copy or a git dependency in your pubspec.yaml.

@GJDK
Copy link

GJDK commented May 18, 2020

Is this plugin using Flutter downloader plugin?

@sanjubhatt2010
Copy link

sanjubhatt2010 commented Sep 15, 2020

I got same error and resoled the crash by following code

override func application(
       _ application: UIApplication,
       didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
   ) -> Bool {
       GeneratedPluginRegistrant.register(with: self)
       GeofencingPlugin.setPluginRegistrantCallback({_ in
       })
       return super.application(application, didFinishLaunchingWithOptions: launchOptions)
   }

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

5 participants