Open Giulio64 opened 5 years ago
Why are you calling multiple times permission request? You need to have only one.
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Permission[] grantResults) { Plugin.Permissions.PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults); }
For common questions and issues see the FAQ
Bug Information
Invoking the method GetPositionAsync() makes the app crash only on android with
Version Number of Plugin: 4.5.0 Device Tested On:Samsung S8 Simulator Tested On: - Version of VS: 8.0.2 Mac Version of Xamarin: 3.1.0 Versions of other things you are using: Plugin.Permission 3.0.0.12
Steps to reproduce the Behavior
Install Plugin.Permission latest version install Xam.Plugin.Geolocator
request position by locator.GetPositionAsync();
Expected Behavior
Actual Behavior
crash with : Fatal signal 11 (SIGSEGV), code 2, fault addr 0x7ff9c4dfe0 in tid 14440
Code snippet
private static async Task ottieniPosizione(List scaricati)
{
if(!await autorizzaGeolocalizzazione()){
return;
}
//Main activity
using System;
using Android.App; using Android.Content; using Android.Content.PM; using Android.OS; using Plugin.FirebasePushNotification; using Firebase; using Plugin.CurrentActivity; using Plugin.Permissions; using SegmentedControl.FormsPlugin.Android; using ZXing.Net.Mobile; using CarouselView.FormsPlugin.Android; using ZXing.Mobile;
namespace CTSApp.Droid { [Activity(Label = "CTSApp", Icon = "@drawable/ic_launcher", Theme = "@style/MyTheme.Splash", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
}
Screenshotst