-
Notifications
You must be signed in to change notification settings - Fork 70
Calling the capture method on ref causes error #36
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
Comments
@idanlo did you solve this issue, I would really appreciate any help! |
@mirhat I did not solve this but apparently this only happens in development, in production build the manual capture works. This still needs to be fixed though. |
I suspect the issue has something to do with this: https://github.com/Woonivers/react-native-document-scanner/blob/master/android/src/main/java/com/documentscanner/DocumentScannerModule.java#L27 The question here is "why does this need to be ran like that, rather than just running the view.capture() method directly?". After all, the capture method will run async and handle all the image processing in the callback method so detecting what thread it's on before calling it is pointless? Am I correct to assume this? I actually rebuilt this package over at https://github.com/HarvestProfit/react-native-rectangle-scanner which you could try out. If the problem persists, then maybe I'm incorrect to assume that, but my package handles all capturing via manually (it uses javascript to auto call the manual capture function). I've had zero issues with this method. |
I'm having the same issue. It would be great to make it work on the simulator too, even if the image is black, to be able to test an app easily :) Does |
@antoinerousseau It does work on an iOS simulator. It just shows a black screen. Also the Not working on a simulator was one of my biggest issues with this package and its derivatives which is why I included that requirement when I built the |
When calling the
ref.current.capture()
method I get this error:The text was updated successfully, but these errors were encountered: