xcode – iOS simulator crashes when requesting microphone permission

My environment:

  • permission_handler 3.0.0
  • Flutter v1.2.1
  • OSX High Sierra 10.13.6
  • Xcode version 10.1.

My application crashes when I request the microphone permission in the iOS simulator.

PermissionStatus mic = wait PermissionHandler ()
.checkPermissionStatus (PermissionGroup.microphone);
print (microphone permission? $ {mic.toString ()} & # 39;);
try {
if (mic! = PermissionStatus.granted) {
wait PermissionHandler (). requestPermissions ([PermissionGroup.microphone])
}
} catch (e) {
print;
}

No errors are returned or intercepted, but in the Flutter Debug Console I see:

flutter: microphone authorization? PermissionStatus.unknown
Lost connection with the device.

It means that checkPermissionStatus () returned unknown. But when I ask permission, the application crashes. I could not try this on a real iPhone. Everything works perfectly on the Android simulator.

I've seen problems with the microphone in Xcode 10.1:

What I've tried

  • New construction with flutter clean
  • Modifying Simulator Microphone Input in Hardware> Audio Input

I could try to upgrade to Xcode 10.2, but I would need mojave first. Try to avoid this if possible as this may not even solve the problem. I can also try using a real iPhone device instead of the simulator. I'd like the simulator not to crash, though.

Anyone can grant microphone permission in Xcode? 10.1/10.2 simulator using permission_handler: 3.0.0? What about another Flutter authorization plugin?