umair13adil / simple_beacons_flutter

A flutter plugin project to range & monitor iBeacons.
Apache License 2.0
35 stars 42 forks source link

Unhandled Exception: MissingPluginException(No implementation found for method startMonitoring on channel beacons_plugin) #23

Closed Wujidadi closed 3 years ago

Wujidadi commented 3 years ago

I've run into this situation: the plugin and my code ran perfectly in Android, but in iOS these errors happened: (for easy reading I took the screenshot of VSCode debug console; the errors were the same while run it from Xcode)

image

It shows in the debug screenshot above exceptions took place while invoking method startMonitoring, but after I commented related codes it turned into other methods (e.g. stopMonitoring, addRegion, etc).

(BTW, the error messages may be as many as hundreds of lines - in the screenshot above, there were actually 381 lines of total error messages.)

My environment:

MacOS 10.15.7 iOS 12.4.8 (iPad) 13.3 (iPhone) Android 8.0.0 Xcode 12.0.1 (12A7300) VSCode 1.49.2 Android Studio 4.0.1 with all SDK after Android 5.1 Lollipop

Thanks for the help!

Wujidadi commented 3 years ago

I've tried every ways I could get from Google, stopped the running project and refreshed it, flutter clean and flutter run/pod install, even removed the project and rebuilt it, or created a new project with the same plugin. All these got the same result.

Wujidadi commented 3 years ago

I got it... BeaconsPlugin.listenToBeacons should not be placed below addRegion or startMonitoring/stopMonitoring. It should be in the first line of all actions of this plugin in the initPlatformState scope, just like it has been in the example.

Sorry for dumb question. Closed.