wifi icon indicating copy to clipboard operation
wifi copied to clipboard

Getting signal strength on iPhoneX emulator causes crash

Open samma opened this issue 5 years ago • 1 comments

This issue occurs on iPhoneX emulator and similar, but it works fine on other emulators such as iPhone7

Calling this

Future<Null> _getWifSignalStrength() async {
    int l = await Wifi.level;
    setState(() {
      _signalStrength = l;
    });
  }

Causes a crash and this stack trace:

*** First throw call stack:
(
	0   CoreFoundation                      0x000000010a8601bb __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x0000000109dfe735 objc_exception_throw + 48
	2   CoreFoundation                      0x000000010a85fd29 -[NSException raise] + 9
	3   Foundation                          0x000000010982acd9 -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 226
	4   Foundation                          0x0000000109829b21 -[NSObject(NSKeyValueCoding) valueForKey:] + 284
	5   Runner                              0x0000000107cec7e0 -[WifiPlugin getSignalStrength] + 176
	6   Runner                              0x0000000107cebfbb -[WifiPlugin handleMethodCall:result:] + 603
	7   Flutter                             0x0000000107fe97ba __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 115
	8   Flutter                             0x00000001080064ac _ZNK5shell21PlatformMessageRouter21HandlePlatformMessageEN3fml6RefPtrIN5blink15PlatformMessageEEE + 166
	9   Flutter                             0x0000000108009ff0 _ZN5shell15PlatformViewIOS21HandlePlatformMessageEN3fml6RefPtrIN5blink15PlatformMessageEEE + 38
	10  Flutter                             0x000000010805cca7 _ZNSt3__110__function6__funcIZN5shell5Shell29OnEngineHandlePlatformMessageEN3fml6RefPtrIN5blink15PlatformMessageEEEE4$_27NS_9allocatorIS9_EEFvvEEclEv + 57
	11  Flutter                             0x0000000108015e0e _ZN3fml15MessageLoopImpl15RunExpiredTasksEv + 522
	12  Flutter                             0x000000010801918c _ZN3fml17MessageLoopDarwin11OnTimerFireEP16__CFRunLoopTimerPS0_ + 26
	13  CoreFoundation                      0x000000010a7c5f34 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
	14  CoreFoundation                      0x000000010a7c5b32 __CFRunLoopDoTimer + 1026
	15  CoreFoundation                      0x000000010a7c539a __CFRunLoopDoTimers + 266
	16  CoreFoundation                      0x000000010a7bfa1c __CFRunLoopRun + 2252
	17  CoreFoundation                      0x000000010a7bee11 CFRunLoopRunSpecific + 625
	18  GraphicsServices                    0x000000010e9491dd GSEventRunModal + 62
	19  UIKitCore                           0x000000011537981d UIApplicationMain + 140
	20  Runner                              0x0000000107cebb70 main + 112
	21  libdyld.dylib                       0x000000010dbb7575 start + 1
	22  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

samma avatar Apr 02 '19 18:04 samma

Running into the same issue, did you find a solution? @samma

ammarhemani avatar Nov 08 '20 09:11 ammarhemani