Closed xtl-geiger closed 10 months ago
The cause was conditional rendering of a parent component, while putting the app into the background.
My bad, it is still happening, but not every time.
In the case I have recorded, the reported issue occurred six seconds after a camera-has-been-disconnected
error:
Camera.onError(session/camera-has-been-disconnected): [session/camera-has-been-disconnected] The given Camera device (id: 0) has been disconnected! Error: DISCONNECTED [session/camera-has-been-disconnected]: [session/camera-has-been-disconnected] The given Camera device (id: 0) has been disconnected! Error: DISCONNECTED
{
arguments: [
Camera.onError(session/camera-has-been-disconnected): [session/camera-has-been-disconnected] The given Camera device (id: 0) has been disconnected! Error: DISCONNECTED,
{
_code: session/camera-has-been-disconnected,
_message: [session/camera-has-been-disconnected] The given Camera device (id: 0) has been disconnected! Error: DISCONNECTED,
message: [session/camera-has-been-disconnected] The given Camera device (id: 0) has been disconnected! Error: DISCONNECTED,
name: session/camera-has-been-disconnected,
stack:
[session/camera-has-been-disconnected]: [session/camera-has-been-disconnected] The given Camera device (id: 0) has been disconnected! Error: DISCONNECTED
at construct (native)
at Wrapper (address at index.android.bundle:1:445833)
at construct (native)
at _createSuperInternal (address at index.android.bundle:1:11391081)
at call (native)
at CameraError (address at index.android.bundle:1:11391557)
at construct (native)
at _createSuperInternal (address at index.android.bundle:1:11391081)
at apply (native)
at CameraRuntimeError (address at index.android.bundle:1:11392061)
at onError (address at index.android.bundle:1:11388929)
at apply (native)
at invokeGuardedCallbackImpl (address at index.android.bundle:1:577433)
at apply (native)
at invokeGuardedCallback (address at index.android.bundle:1:577490)
at apply (native)
at invokeGuardedCallbackAndCatchFirstError (address at index.android.bundle:1:577522)
at executeDispatch (address at index.android.bundle:1:577654)
at executeDispatchesAndReleaseTopLevel (address at index.android.bundle:1:581911)
at call (native)
at forEachAccumulated (address at index.android.bundle:1:579137)
at anonymous (address at index.android.bundle:1:582263)
at batchedUpdatesImpl (address at index.android.bundle:1:641456)
at batchedUpdates (address at index.android.bundle:1:581831)
at _receiveRootNodeIDEvent (address at index.android.bundle:1:582104)
at receiveEvent (address at index.android.bundle:1:635961)
at apply (...
}
]
}
Do you have any suggestions or workarounds for a solution?
Hey! Thanks for reporting this issue.
I've been working the past days on making sure the Camera lifecycle is safely handled and released when needed to make sure this crash doesn't occur anymore.
I just created a PR for this - can you please this to see if that fixes the issue for you? https://github.com/mrousavy/react-native-vision-camera/pull/2339
If this fixes your issue, please consider š sponsoring me on GitHub š to support me / thank me for building VisionCamera and continuously improving it.
If this does not fix your issue, please clone the repo, check out the branch fix/blackscreen
(the PR above), run the Example app, reproduce your issue there and share the adb logcat
logs with me (upload to pastebin or gist) so I can investigate this further.
Thank you! š
What's happening?
During scanning barcodes, despite setting the Camera component inactive, starting a native camera intent is crashing vision camera.
Reproduceable Code
Relevant log output
Camera Device
Device
Multiple devices
VisionCamera Version
3.1.x
Can you reproduce this issue in the VisionCamera Example app?
I didn't try (ā ļø your issue might get ignored & closed if you don't try this)
Additional information