Open ChrisKrause opened 4 years ago
Same problem here. My Code:
Page code public SamplePage() { var permissionsGranted = PermissionGranted().Result; if (!permissionsGranted) { //TODO } }
private async Task
Application hangs on RequestPermissionAsync method.
Any ideas?
If you are creating an issue for a BUG please fill out this information. If you are asking a question or requesting a feature you can delete the sections below.
Failure to fill out this information will result in this issue being closed. If you post a full stack trace in a bug it will be closed, please post it to http://gist.github.com and then post the link here.
Bug Information
Version Number of Plugin: 5.0.0 Device Tested On: Android Emulator, Samsung A20 and Samsung A7 (2018) Simulator Tested On: Android Simulator from Visual studio Version of VS: 2019 version 16.4.4 Version of Xamarin: 16.4.00.309 Versions of other things you are using: Xamarin.Android.SDK 10.1.3.7
Steps to reproduce the Behavior
Android forms app Request camera permission
Expected Behavior
Camera permission set and application continues
Actual Behavior
Camera permission is set but application hangs
Code snippet
var status = await CrossPermissions.Current.CheckPermissionStatusAsync();
if (status != PermissionStatus.Granted)
{
await CrossPermissions.Current.RequestPermissionAsync();
status = await CrossPermissions.Current.CheckPermissionStatusAsync();
}
0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal C# 0x1 in System.Diagnostics.Debugger.Mono_UnhandledException at /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/corlib/System.Diagnostics/Debugger.cs:120,4 C# 0x20 in Android.Runtime.DynamicMethodNameCounter.44 C# 0x12 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw at /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:157,13 C# 0x6 in System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__7_0 at /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021,49 C#
0xC in Android.App.SyncContext. C#
0xE in Java.Lang.Thread.RunnableImplementor.Run C#
0xA in Java.Lang.IRunnableInvoker.n_Run C#
0x11 in Android.Runtime.DynamicMethodNameCounter.44 C#