question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS crashes with NullReferenceExpcetion in iOS if Camera access is disabled from Settings

See original GitHub issue

Repro:

  1. Create two pages in a Xamarin Forms page, an Entry page and a Scanner page
  2. Add Zxing to Scanner page but leave IsVisible = false
  3. On iOS mobile device, in Settings disable Camera access to the app
  4. Open the App navigate from Entry page to Scanner Page and Navigate Back

Expected: App should navigate back to the entry page

Actual:

Throws ‘Object reference not set to an instance of an object’ - NullReferenceException

Stack Trace:

ZXingScannerViewRenderer.OnElementChanged (Xamarin.Forms.Platform.iOS.ElementChangedEventArgs`1[TElement] e)AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state)
NSAsyncSynchronizationContextDispatcher.Apply ()(wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate)
UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName)
Application.Main (System.String[] args)

Applies to ZXing.Net.Mobile version 3.0.0-beta5

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

2reactions
gsgoucommented, Feb 27, 2021

I see it also on 3.0.0-beta5. Is Xamarin.Forms requirement 5.0.0.1874 or above inevitable for the upcoming releases https://github.com/Redth/ZXing.Net.Mobile/commit/c73484446f71859e0183160b14061a40382d87bf ?

1reaction
MStrannikcommented, Aug 26, 2021

Latest “stable” version ZXing.Net.MobileX.Forms 3.0.1. Xamarin.Forms 5.0.0.2012 also have this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App crashes on enabling Camera Access from Settings iOS 8
I am developing an app for iPhone, it is using camera for scanning barcodes and taking pictures. When we don't have Camera access...
Read more >
'(Null)' is using camera access to contro…
'(Null)' is using camera access to control connected cameras. This includes taking photos and videos, accessing files and recording audio.
Read more >
All AR apps crash on allow camera access
When developing an AR app in Unity you can make a check to see if the device is AR supported and all it...
Read more >
(Null) is using camera access to control connected cameras.
According to the Apple community, this means that an app hasn't been synced properly and that's why it's coming up as null, also...
Read more >
Troubleshooting on iOS devices
This message typically appears on iOS devices when your application receives a NullReferenceException. Use Native stack traces to find out ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found