Redth / ZXing.Net.Mobile

Barcode Scanner for Xamarin.iOS, Xamarin.Android, UWP and Tizen
MIT License
1.07k stars 703 forks source link

Android: Crashes when trying to Open ZXingScannerPage #248

Closed chrismcb closed 8 years ago

chrismcb commented 8 years ago

Android throws an Object reference not set to an instance of an object error when you try to open ZXingScannerPage.

I verified this with the sample using Nuget packages. It works with 2.0.3.1 but crashes with 2.0.4.17+ I was unable to get the sources to build properly to track it down any further

Redth commented 8 years ago

Going to need a lot more info here....

alexsandro-xpt commented 8 years ago
    async void CallScanner(object sender, EventArgs e)
    {
        var scanPage = new ZXingScannerPage();

Unhandled Exception: System.MissingMethodException: Method 'Element.set_AutomationId' not found.

Using the https://components.xamarin.com/gettingstarted/zxing.net.mobile.forms page example:

var scanPage = new ZXingScannerPage ();

scanPage.OnScanResult += (result) => {
    // Stop scanning
    scanPage.IsScanning = false;

    // Pop the page and show the result
    Device.BeginInvokeOnMainThread (() => {
        Navigation.PopAsync ();        
        DisplayAlert("Scanned Barcode", result.Text, "OK");
    });
};

// Navigate to our scanner page
await Navigation.PushAsync (scanPage);
teerasej commented 8 years ago

I found same problem with @alexsandro-xpt.

The exception raised after this statement: await Navigation.PushAsync (scanPage);

Tested on this device:

srsivaprasad commented 8 years ago

same issue for me also.

alexsandro-xpt commented 8 years ago

I forget the XF implementantion and call the native UI and Scanner Engine, it's mutch more responsive.

almirvuk commented 8 years ago

Same here, any info about this issue?

mishanatsvlishvili commented 7 years ago

have the same problem, any news?

timothyparez commented 7 years ago

Same issue here

EmreErinc commented 6 years ago

2 months ago there is no issue on my app but now i am getting that issue.