Skip to content
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

Pausing and detaching causes crash on Android #61

Open
mrfrasier opened this issue Oct 29, 2015 · 11 comments
Open

Pausing and detaching causes crash on Android #61

mrfrasier opened this issue Oct 29, 2015 · 11 comments
Labels

Comments

@mrfrasier
Copy link

For my application, users can scan QR codes back to back. I pause in between each scan (calling detach and pausePreview on scan), display a confirmation for about a second, then resume preview and reattach.

Works fine on iOS, but on Android calling resumePreview doesn't do anything. My workaround for android is to only call detachScannerFromPreview (to prevent rapid scanning before the user can move on to the next QR code) and then call attachScannerToPreview() after a second or so (leaving the preview active).

This works for about 2-3 scans before simply crashing each time.

Firstly, am I doing this right? Is detaching and pausing the right way to accomplish what I'm looking to do? If so, any ideas why it doesn't work on Android and why calling detach and attach a few times causes a crash?

@saumitrabhave
Copy link
Owner

Certainly looks like a bug, can you share crash log from adb logcat. Meanwhile i will also check if i can find some workaround for your usecase.

@mrfrasier mrfrasier changed the title Puasing and detaching causes crash on Android Pausing and detaching causes crash on Android Oct 30, 2015
@mrfrasier
Copy link
Author

Of course. I can't attach docs here, but here it is on pastee:
https://paste.ee/p/qAnEL

@saumitrabhave
Copy link
Owner

Hi: I looked at your paste... but I could not find any crash there. Are you sure you did not have any filters on logcat like appName or log level.

@mrfrasier
Copy link
Author

Sorry, missed your response. There doesn't seem to be anything in the log when it crashes, but I'll try it again.

@mrfrasier
Copy link
Author

Hi, on my end all I see the is app die. Have you found anything in the code?

@mrfrasier
Copy link
Author

crash

Got the crash

@saumitrabhave
Copy link
Owner

Hey , thanks for sharing the crash. Let me have a look at the code.... Will get back ASAP.

@mrfrasier
Copy link
Author

Thank ya

@mrfrasier
Copy link
Author

Well, naturally not ideal, but if anyone else runs into this, I solved it by just using a Video object and sampling the bitmap data to the Scanner.scanBitmapData() method

@rjx444
Copy link

rjx444 commented Sep 6, 2018

Hi,
How @mrfrasier did you manage to solve the issue?
Thanks

@mrfrasier
Copy link
Author

Wow old post haha, but I solved it by using a different class on Android. I created a video object to use and render the camera. Then on a timer I take a snapshot from the camera object and pass that to the QR reader ANE to analyze

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants