So, at the beginning of my application, users have the ability to scan a QR code. In the application settings, the user can scan another barcode to change some data in the settings.
At the beginning of my application, the scanner works fine, but when I try to scan the barcode in the VC settings, I get the following warning:
Warning: Attempt to present ZXing.Mobile.ZXingScannerViewController: 0x18036dc0 on UINavigationController: 0x16d8afe0 whose view is not in the window hierarchy!
I already tried to call the viewDidAppear check, but I get the same warning.
button_ScanAPI.TouchUpInside += async (sender, e) => { var scanner = new ZXing.Mobile.MobileBarcodeScanner (); var result = await scanner.Scan (); if (result != null) { textField_APIKey.Text = result.Text; } };
EDIT:
I tried using a barcode scanner without async, but I still get the same msg.
var scanner = new ZXing.Mobile.MobileBarcodeScanner (); scanner.Scan (true).ContinueWith (t => { if (t.Result != null) { InvokeOnMainThread (() => { textField_APIKey.Text = t.Result.Text; }); } });
And I also tried using AVFoundation, which led to the same error:
Warning: Attempt to present <AVCaptureScannerViewController: 0x16fb1d00> on <UINavigationController: 0x16ebe790> whose view is not in the window hierarchy!
EDIT2:
This is part of the stream in my application.

source share