-
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
app passed NULL surface, then scanning stops working #876
Comments
Can you provide a sample which reproduces this? I'm a bit confused as you're saying "while the scanner is up, if anything else uses the camera"... What are you trying to do in your app exactly? I don't think multiple things can use the camera at the same time... |
Sure, Github is limiting me to a 10MB upload, so I can't include a full app solution (zipped is 49MB) but I've attached the key files. All I did was create a new Xamarin project (blank template) and brought in the ZXing.Net.Mobile + ZXing.Net.Mobile.Forms packages from NuGet (version 2.4.1 in this case). Then I put a scan result event in the code behind and display the barcode scanned. I'm using MVVM in my main app, but the event displays the same behavior as going through commands + binding. In order to reproduce the issue:
I've worked around this in my main app by loading a new Scanner control in OnAppearing. Perhaps this is intended design, and I just have my expectations out of line. As for specifics to the app, it is intended for delivery drivers and warehouse employees to scan inventory and do CRUD operations on data related to scanned inventory. The app provides the ability to take photos and apply said photos to selected inventory (damaged, proof of X, etc.). I first ran into this issue when going through the test scenario of:
I hope that helps to clear things up. Let me know if I can provide any more info! |
I can add some info to this as it's one I've been struggling with in 2.4.1 (and is why I was fooling around today with a 3.0.0 beta - hoping this was fixed, but 3.0.0 un-usable ATM for other reasons. :-( Will post about that elsewhere). This is all Android only (works ok on UWP) on both a Note Edge and an S7, both running Android 6.0.1.
Here is a log file with both messages (and everything else, from initialisation to crash)... 08-12 17:09:57.060 D/Mono (19817): AOT: image '/Users/builder/jenkins/workspace/xamarin-android-d15-9/xamarin-android/external/mono/sdks/out/android-armeabi-v7a-release/lib/mono/aot-cache/arm/System.Diagnostics.Debug.dll.so' not found: dlopen failed: library "/data/app/com.companyname.Inventory-1/lib/arm/libaot-System.Diagnostics.Debug.dll.so" not found [0:] Binding: 'DefaultOverlayBottomText' property not found on 'ZXing.Net.Mobile.Forms.ZXingDefaultOverlay', target property: 'ZXing.Net.Mobile.Forms.ZXingDefaultOverlay.BottomText' |
I am experiencing a similar issue on a Xamarin Android (not Xamarin Forms) app with NuGet package version 2.4.1. In my case I see the ''app passed NULL surface" message, but not the "Camera service died!" message. I cloned the project and found that the issue was actually fixed by the merge of pull request #709 for #569 on 19- Apr-2018 (commit 31cc61a), which was shortly after the 2.4.1 version of the NuGet package was released (4 Apr 2018). Testing shows that it resolves the issue for me. |
+1. I am also experiencing this issue on 2.4.1. I tried upgrading to 3.0.0-beta5, but ran into another issue initializing the scanner in that version. |
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) |
First off, thank you for the awesome package. Other than the issue I'm running into, it's been a real time saver!
I've got the ScannerView working well with v2.4.1 in my Xamarin.Forms app. On first load, it scans properly and all is well. While the scanner is up, if anything else uses the camera, I get "app passed NULL surface" in the console output. I've accessed the camera via:
After this message in the console, I can no longer get a scan. The camera preview is still showing and the autofocus is still working, but I do not get "barcode detected" in the output window anymore when scanning the same barcode in the same lighting / conditions that worked just prior to the "app passed NULL surface" message.
On v3.0beta5 I get the same message on first load of the ScannerView, along with the autofocus not working, and am unable to get a scan.
Testing on a Samsung Galaxy S6 device.
Issue #550 seems to explain a lot of the same symptoms, and I'm trying to implement some of their suggestions to see if it helps, but was hopeful to bring this to the author's attention since it was closed.
If I can provide any additional information please let me know.
Thank you!
The text was updated successfully, but these errors were encountered: