My environment:
- permission_handler 3.0.0
- Flutter v1.2.1
- OSX High Sierra 10.13.6
- Xcode version 10.1.
My app is crashing when I request the permission for microphone in the iOS simulator.
PermissionStatus mic = await PermissionHandler()
.checkPermissionStatus(PermissionGroup.microphone);
print('microphone permission? ${mic.toString()}');
try {
if (mic != PermissionStatus.granted) {
await PermissionHandler().requestPermissions([PermissionGroup.microphone]);
}
} catch (e) {
print(e);
}
No error is thrown or caught, but in the flutter debug console, I see:
flutter: microphone permission? PermissionStatus.unknown
Lost connection to device.
This means that checkPermissionStatus()
returned unknown
. But then when I request the permission, the application crashes. I have not been able to try this on a real iPhone. Everything works perfectly on the Android simulator.
I've seen there were some problems in Xcode 10.1 with the microphone:
- iOS Simulator would like to access microphone every time
- Repeated request for microphone permission on iOS Simulator
What I've tried
- Fresh build with
flutter clean
- Changing the simulator microphone input in Hardware > Audio Input
I could try to upgrade to Xcode 10.2, but I'd need to get mojave first. Trying to avoid that if possible as it might not even fix the issue. I can also try using a real iPhone device instead of the simulator. Would love to get the simulator not crashing, though.
Is anyone able to grant microphone permission in Xcode 10.1
/10.2
simulator using permission_handler: 3.0.0
? What about another flutter permission plugin?