Open
Description
Describe the Bug
The camera preview does not display (blank screen) when using <Camera>
from react-native-camera-kit
on iOS. Barcode scanning does not work, and Xcode logs indicate rendering errors. This issue persists on a physical iOS device.
To Reproduce
Steps to reproduce the behavior:
- Install the package:
yarn add react-native-camera-kit cd ios && pod install yarn start --reset-cache
- Add camera permissions to
Info.plist
:<key>NSCameraUsageDescription</key> <string>We need access to your camera for barcode scanning.</string>
- Implement the component:
import { Camera } from 'react-native-camera-kit'; return ( <Camera style={{ flex: 1 }} cameraType="back" scanBarcode={true} onReadCode={(event) => console.log('Scanned:', event.nativeEvent.codeStringValue)} showFrame={true} laserColor="red" frameColor="blue" /> );
- Run on a real iOS device.
- The screen remains blank, with no camera preview or barcode scanning.
- The Torch and the barcode however works fine when I try to scan without saying the barcode. Only a white screen instead of Camera.
Expected Behavior
- The camera preview should be visible.
- Barcode scanning should work as expected.
- The component should mount without errors.
Screenshots
- Device: iPhone 15 pro
- OS: iOS 18.3.1
Additional Context
-
Xcode Logs:
nw_socket_handle_socket_event [C12:1] Socket SO_ERROR [61: Connection refused] CGBitmapContextCreate: unsupported parameter combination: NULL colorspace react_native_expect failure: value.hasType<std::vector<RawValue>>()
-
What I’ve Tried:
- Verified
Info.plist
contains correct camera permissions. - Ran the app in Release Mode (
react-native run-ios --configuration Release
). - Restarted Metro Bundler (
yarn start --reset-cache
). - Ran on a real iOS device.
- Added
onError={(err) => console.error("Camera Error:", err)}
but no additional logs appeared.
- Verified
-
Works fine on Android.
Could this be an issue with the latest iOS update or package compatibility?
Metadata
Metadata
Assignees
Labels
No labels