-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
🐛 InitializationException - Device reporting less cameras than anticipated #3179
Comments
Guten Tag, Hans here 🍻 Thanks for your detailed report! It sounds like a tricky issue, and I appreciate you trying to gather as much information as possible. However, we need more logs to help mrousavy effectively troubleshoot this problem. Please capture the logs using If you need help with gathering the logs, feel free to ask! The more data we have, ze easier it will be to find a solution. Looking forward to your update!
|
Hey, I have same problem on production, multiple crashes in crashlytics (its small % of users, but enough to be one of main reason for our crashes currently). Maybe my information will help you somehow to debug this.
I add stacktarce from one of crashes. Name of error is |
Well, Camera APIs on Android suck. |
Started seing this out of the sudden on Android 9 on 4.5.2, rn 0.75.3. Can reproduce it locally on Pixel 4XL emulator running Android 9. @mrousavy do you need any logs or screw camera apis 😂? |
Some extra information around the bug, Simulator Pixel 4XL Android 9, same thing happens on real devices though.
stack:
edit: tried with |
Hello guys, I just found a way to reproduce the issue.
Thanks guys for pointing nearly all the versions that have the issue. As a result I use Below is my final version in
Hope it can help. |
Same issue with react-native-vision-camera 4.5.2 |
same issue |
Same here:
|
same problem |
same issue "react-native": "0.73.9", |
any help ? |
Same issue here. |
Same issue here... |
We are having the same issue here:
|
any updates ? |
Unfortunately, no one can reproduce the error concisely. :( |
Has the camerax version has been updated to 1.4.0 ? I am also facing this issue post version update & have raised it here. Have raised it here |
react-native-vision-camera/package/android/build.gradle Lines 185 to 192 in 54df86a
|
@mrousavy We are using version 4.6.1, and our build.gradle file is the same as the one you provided, 1.5.0-alpha03. However, some phones are still reporting this error. |
still same |
still same, we get this error on some devices. do you have any suggestions for a solution? |
Still same. Is there a solution for this? |
any updates ? thie issue happen today for 15 user. |
I am also getting this crash in firebase crashlytics |
So do i |
+1 Same issue |
i am also getting the same error.
details: Devices Operating system `androidx.camera.core.InitializationException: androidx.camera.core.CameraUnavailableException: Device reporting less cameras than anticipated. On real devices: Retrying initialization might resolve temporary camera errors. On emulators: Ensure virtual camera configuration matches supported camera features as reported by PackageManager#hasSystemFeature. Available cameras: 0 at androidx.camera.core.CameraX.lambda$initAndRetryRecursively$2$androidx-camera-core-CameraX(CameraX.java:433) at androidx.camera.core.CameraX$$ExternalSyntheticLambda2.run(D8$$SyntheticClass:0) at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:784)` |
This comment has been minimized.
This comment has been minimized.
Hi everyone, Handling for this is to wrap the |
The app will crash? Can i ignore this error? |
created a PR to potentially fix this: #3373 |
anyone can confirm if this pr works ? |
@Nader-CS you need fix the variable declaration for |
Hey @mrousavy, When you've got a spare moment, can you maybe review my PR aiming to fix this issue? #3385 It follows through on what I think were your intentions, with your PR, and seems to work locally. (And would be my first contribution to the library, so if you like making people feel special, there's that, too 💫) |
What's happening?
I am encountering a crash reported in Crashlytics, related to
androidx.camera.core.InitializationException
. The issue seems to occur when the app attempts to initialize the camera, and it reports fewer cameras than expected, resulting in aCameraUnavailableException
. This crash happens on real devices, and it mentions retrying initialization. However, I cannot reproduce the issue locally on my test devices, so I’m unable to investigate further in a controlled environment.Reproduceable Code
Relevant log output
Camera Device
Device
The crash affects multiple devices, with the following breakdown: Motorola (69%) Samsung (17%) Xiaomi (14%). Operating system versions: Android 11 (62%) Android 13 (21%) Android 12 (17%).
VisionCamera Version
4.5.2
Can you reproduce this issue in the VisionCamera Example app?
No, I cannot reproduce the issue in the Example app
Additional information
The text was updated successfully, but these errors were encountered: