iOS crashes with NullReferenceExpcetion in iOS if Camera access is disabled from Settings
See original GitHub issueRepro:
- Create two pages in a Xamarin Forms page, an Entry page and a Scanner page
- Add Zxing to Scanner page but leave IsVisible = false
- On iOS mobile device, in Settings disable Camera access to the app
- 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:
- Created 3 years ago
- Reactions:1
- Comments:6
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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 ?
Latest “stable” version ZXing.Net.MobileX.Forms 3.0.1. Xamarin.Forms 5.0.0.2012 also have this issue.