title: NullPointerException with zxing library for QR scanning (android app Xamarin Froms)
body: <p>The zxing QR code reader gives crash with  <strong>Java.Lang.NullPointerException: 'Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference'</strong>  below are the code which i added.</p>
  
  <pre><code>        {
              try
              {
                  Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
  
                  base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
                  PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
                  global::ZXing.Net.Mobile.Android.PermissionsHandler.OnRequestPermissionsResult(requestCode, permissions, grantResults);
              }
              catch (Exception)
              {
                  return;
              }
          }
  // and 
   try
              {
                  ZXing.Mobile.MobileBarcodeScanner.Initialize(Application);
  
                  ZXing.Net.Mobile.Forms.Android.Platform.Init();
              }
              catch (Exception)
              {
                  return;
              }
   // on the on create 
  
  // button click 
  
          private async void Button_Clicked(object sender, EventArgs e)
          {
              try
              {
                  _scanPage = new ZXingScannerPage();
                  if (_scanPage != null)
                  {
                      _scanPage.OnScanResult += (result) =&gt;
                      {
                          _scanPage.IsScanning = false;
  
                          Device.BeginInvokeOnMainThread(() =&gt;
                          {
                              Navigation.PopAsync();
                              DisplayAlert("Scanned Barcode", result.Text, "OK");
                          });
                      };
                  }
  
                  await Navigation.PushAsync(_scanPage).ConfigureAwait(true);
              }
              catch (Exception)
              {
                  return;
              }
          }
  </code></pre>
  
  <p>The Plugin Details are below </p>
  
  <p><strong>ZXing.Net.Mobile 2.4.1</strong> and <strong>ZXing.Net.Mobile.Forms 2.4.1</strong></p>
  
  <p>please suggest me is there is any other plugin which we can use instead </p>