Troubleshooting

Steps to try​
If you're experiencing build issues or runtime issues in VisionCamera, make sure you try the following before opening an issue:
- iOS
- Android
Build Issues​
- Try building through Xcode instead of the commandline. The error panel should give you more information about any build errors.
- Try cleaning and rebuilding everything:
rm -rf package-lock.json && rm -rf yarn.lock && rm -rf node_modules
rm -rf ios/Podfile.lock && rm -rf ios/Pods
npm i # or "yarn"
cd ios && pod repo update && pod update && pod install - Check your minimum iOS version. VisionCamera requires a minimum iOS version of 12.4.
- Open your
Podfile - Make sure
platform :iosis set to12.4or higher - Make sure
iOS Deployment Targetis set to12.4or higher (IPHONEOS_DEPLOYMENT_TARGETinproject.pbxproj)
- Open your
- Check your Swift version. VisionCamera requires a minimum Swift version of 5.2.
- Open
project.pbxprojin a Text Editor - If the
LIBRARY_SEARCH_PATHvalue is set, make sure there is no explicit reference to Swift-5.0. If there is, remove it. See this StackOverflow answer. - If the
SWIFT_VERSIONvalue is set, make sure it is set to5.2or higher.
- Open
- Make sure you have created a Swift bridging header in your project.
- Open your project (
.xcworkspace) in Xcode - Press File > New > File (⌘+N)
- Select Swift File and press Next
- Choose whatever name you want, e.g.
File.swiftand press Create - Press Create Bridging Header when promted.
- Open your project (
- Try building without Frame Processors. Set
$VCEnableFrameProcessors = falsein the top of your Podfile, and try rebuilding.
Runtime Issues​
- Check the logs in Xcode to find out more. In Xcode, go to View > Debug Area > Activate Console (⇧+⌘+C).
- For errors without messages, there's often an error code attached. Look up the error code on osstatus.com to get more information about a specific error.
- If your Frame Processor is not running, make sure you check the native Xcode logs. There is useful information about the Frame Processor Runtime that will tell you if something goes wrong.
- If your Frame Processor is not running, make sure you are not using a remote JS debugger such as Google Chrome, since those don't work with JSI.
- If you are experiencing black-screens, try removing all properties such as
fps,videoHdrorformaton the<Camera>component except for the required ones:<Camera device={device} isActive={true} style={{ width: 500, height: 500 }} /> - Investigate the camera devices this phone has and make sure you're using a valid one. Look for properties such as
idandhardwareLevel.const devices = Camera.getAvailableCameraDevices()
console.log(JSON.stringify(d, null, 2))
Build Issues​
- Try building through Android Studio instead of the commandline. The error panel should give you more information about any build errors.
- Scroll up in the build output to make sure you're not missing any errors. Remember: "Build failed" is not an error message. Scroll further up.
- Try cleaning and rebuilding everything:
./android/gradlew clean
rm -rf android/.gradle android/.idea android/app/build android/build
rm -rf package-lock.json bun.lockb node_modules
bun install # or `npm i` - Make sure you have installed the Android NDK.
- Make sure your minimum SDK version is 21 or higher, and target SDK version is 33 or higher. See the example's
build.gradlefor reference.- Open your
build.gradle - Set
buildToolsVersionto33.0.0or higher - Set
compileSdkVersionto33or higher - Set
targetSdkVersionto33or higher - Set
minSdkVersionto21or higher - Set
ndkVersionto"23.1.7779620"or higher - Update the Gradle Build-Tools version to
7.3.1or higher:classpath("com.android.tools.build:gradle:7.3.1")
- Open your
- Make sure your Gradle Wrapper version is
7.5.1or higher. Ingradle-wrapper.properties, set:distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip - Try building without Frame Processors. Set
VisionCamera_enableFrameProcessors = falsein yourgradle.properties, and try rebuilding.
Runtime Issues​
- Check the logs in Android Studio/Logcat to find out more. In Android Studio, go to View > Tool Windows > Logcat (⌘+6) or run
adb logcatin Terminal. Android Logcat logs look like this:09:03:46 I ReactNativeJS: Running "App" with {"rootTag":11}
09:03:47 I VisionCamera: Loading native C++ library...
09:03:47 I VisionCamera: Installing JSI bindings...
09:03:47 I VisionCamera: Finished installing JSI bindings!
... - If a camera device is not being returned by
Camera.getAvailableCameraDevices(), make sure it is a Camera2 compatible device. See this section in the Android docs for more information. - If your Frame Processor is not running, make sure you check the native Android Studio/Logcat logs. There is useful information about the Frame Processor Runtime that will tell you if something goes wrong.
- If your Frame Processor is not running, make sure you are not using a remote JS debugger such as Google Chrome, since those don't work with JSI.
- If you are experiencing black-screens, try removing all properties such as
fps,videoHdr,pixelFormatorformaton the<Camera>component except for the required ones:<Camera device={device} isActive={true} style={{ width: 500, height: 500 }} /> - Investigate the camera devices this phone has and make sure you're using a valid one. Look for properties such as
idandhardwareLevel.const devices = Camera.getAvailableCameraDevices()
console.log(JSON.stringify(d, null, 2))
Issues​
If nothing has helped so far, try browsing the GitHub issues. If your issue doesn't exist, create a new one. Make sure to fill out the template and include as many details as possible. Also try to reproduce the issue in the example app.