🐛 `java.util.concurrent.TimeoutException`: Android release APK black screen on camera launch
What's happening?
we are using version 4.0.0 when camera component is mounted and isActive is true camera is not getting launch and showing black screen attaching logs from android studio
Platform: Android Previous React Native Version: 0.71.3 where camera working fine Current React Native version: 0.73.6 with New RN Fabric architecture enabled where camera is not working
Reproduceable Code
import { Camera, useCameraDevice, useCodeScanner } from 'react-native-vision-camera';
const device = useCameraDevice('back');
const codeScanner = useCodeScanner({
codeTypes: ['qr', 'ean-13'],
onCodeScanned,
});
<Camera
device={device}
isActive={isCameraOn}
style={StyleSheet.absoluteFill}
orientation="portrait"
codeScanner={codeScanner}
torch={flashMode ? 'on' : 'off'}
/>
Relevant log output
Camera2CameraImpl E Unable to configure camera Camera@f43c463[id=0]
java.util.concurrent.TimeoutException: Future[androidx.camera.core.impl.utils.futures.ListFuture@79f35cd] is not done within 5000 ms.
androidx.camera.core.impl.utils.futures.Futures.lambda$makeTimeoutFuture$1(SourceFile:33)
androidx.camera.core.impl.utils.futures.Futures.f(SourceFile:1)
at montrancli.c0.a.call(SourceFile:1)
at androidx.camera.core.impl.utils.executor.HandlerScheduledExecutorService$HandlerScheduledFuture.run(SourceFile:14at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.os.HandlerThread.run(HandlerThread.java:67)
Camera Device
{
hardwareLevel: "limited",
hasFlash: true,
hasTorch: true,
id: "0",
isMultiCam: false,
maxExposure: 20,
maxZoom: 4,
minExposure: -20,
minFocusDistance: 0,
minZoom: 1,
name: "0 (BACK) androidx.camera.camera2",
neutralZoom: 1,
physicalDevices: ["wide-angle-camera"],
position: "back",
sensorOrientation: "landscape-left",
supportsFocus: true,
supportsLowLightBoost: false,
supportsRawCapture: false,
}
Device
samsung-SM-M305F-Android-10
VisionCamera Version
4.0.0
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
- [ ] I am using Expo
- [ ] I have enabled Frame Processors (react-native-worklets-core)
- [X] I have read the Troubleshooting Guide
- [X] I agree to follow this project's Code of Conduct
- [X] I searched for similar issues in this repository and found none.
hi @mrousavy i have updated camera device please let me know if you need any further details Thankyou!
thanks, but at the moment I don't have time to investigate issues that are not paid/sponsored.