Xamarin.forms StartForeground运行时无法启动Zxing

Xamarin.forms StartForeground运行时无法启动Zxing,xamarin.forms,Xamarin.forms,如果您正在从Android.App服务运行Start前台 我在启动Zxing(条形码读取)时出错 } 服务中断 意向服务意向=新意向(此,类型为(后台服务));*“BackgroundService”是正在运行的服务类 Base.StopService(serviceIntent) 使用StopSelf()方法停止 结果,什么问题都解决不了。您好,您的代码的哪一部分调用了这个?你想达到什么目标?您试图解决什么问题?谢谢您的回复。2020/12/22:查询的详细信息已更新。 Error det

如果您正在从Android.App服务运行Start前台 我在启动Zxing(条形码读取)时出错

}

  • 服务中断 意向服务意向=新意向(此,类型为(后台服务));*“BackgroundService”是正在运行的服务类 Base.StopService(serviceIntent)

  • 使用StopSelf()方法停止


  • 结果,什么问题都解决不了。

    您好,您的代码的哪一部分调用了这个?你想达到什么目标?您试图解决什么问题?谢谢您的回复。2020/12/22:查询的详细信息已更新。
    Error details: Compatible code is not running.
    Selective debug execution may or may not be the executable code running in the current thread.
    Unhandled Exception:
    Java.Lang.NullPointerException: <Timeout exceeded getting exception details>
    
     void Handle_OnScanResult (ZXing.Result result)
     {
         Device.BeginInvokeOnMainThread (async () =>
         {
             zxing.IsAnalyzing = false;
             await Navigation.PopAsync ();
             await DisplayAlert ("notification", "Read the following value:" + result.Text, "OK");
             zxing.IsAnalyzing = true;
         });
     }
    
     protected override void OnAppearing ()
     {
         try
         {
             base.OnAppearing ();
             zxing.IsScanning = true;
         }
         catch (Exception ex)
         {
    
             DisplayAlert ("ExErr",
                 $ "{ex.Message}", Msg.Button.Ok);
         }
     }
    
     protected override void OnDisappearing ()
     {
         zxing.IsScanning = false;
         base.OnDisappearing ();
     }