0

I've run into this situation: the plugin and my code ran perfectly in Android, but in iOS these errors happened:
(Screenshot - my reputation is too low to post images. For easy reading I took the screenshot of VSCode debug console; the errors were the same while run it from Xcode)

https://user-images.githubusercontent.com/10349431/94634472-b2d42e80-0302-11eb-9dc7-fa2956511b82.png

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 any help!

CCK
  • 23
  • 5

2 Answers2

2

I got it... In this case, 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.

CCK
  • 23
  • 5
0

This error mostly occurs when you try to Hot Reload or Hot Restart after just adding new package to your pubspec.yaml.

Just stop the running project(app) and then freshly run it again. So that the added package(which contains the implementations) also pushed to the device

please check : https://stackoverflow.com/a/60088062/11989529

and this : MissingPluginException while using plugin for flutter

the same problem

ElsayedDev
  • 601
  • 1
  • 8
  • 15
  • Thanks for answering! However, I've tried every ways I could get from Google, even removed the project and rebuilt it, or created a new project with the same plugin. All these got the same result. – CCK Sep 30 '20 at 03:48