-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java.Lang.NullPointerException When Attempting to Initialize ContentPage with Scanner #943
Comments
If you go back to stable version 2.4.1, does the crash go away? |
I circumvent this by considering the Scanner page a modal page, launched by whatever page needs to scan something, and closing it as soon as barcode is scanned. Parent/launching page interprets the barcode. (Version 2.4.1 and 3.1.0-beta2) |
@knocte |
At the end I removed a |
… inside a ContentView If the `ZXingScannerView` was inside of a `ContentView` instead of a `ContentPage`, the application would crash by throwing a `Java.Lang.NullPointerException`. The `Context` passed to `ZXingScannerViewRenderer` via the constructor was actually a `ContextThemeWrapper` which does not inherit from `Activity`. Therefore when it was cast in the call of the constructor of `ZXingScannerView` in the renderer on Android, a `null` would be passed for a context instead. Fixes: Redth#943
Version: 3.0.0-beta5
Platform: Android 10/API 29
Scanner initialization (in code behind):
Scanner XAML:
<Frame x:Name="QrCodeScanner" BorderColor="{StaticResource BorderColor}"/>
When navigating to this particular page,
OnAppearing()
is called, then immediately after, I get the following exception:Here is the full stack trace/debug output:
Let me know if I can provide any further clarification on this.
The text was updated successfully, but these errors were encountered: