Troubleshooting
Before opening an issue, make sure you try the following:
iOS​
- 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 :ios
is set to12.4
or higher - Make sure
iOS Deployment Target
is set to12.4
or higher (IPHONEOS_DEPLOYMENT_TARGET
inproject.pbxproj
)
- Open your
- Check your Swift version. VisionCamera requires a minimum Swift version of 5.2.
- Open
project.pbxproj
in a Text Editor - If the
LIBRARY_SEARCH_PATH
value 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_VERSION
value is set, make sure it is set to5.2
or 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.swift
and press Create - Press Create Bridging Header when promted.
- Open your project (
- If you're having build issues, try:
- Building without Skia. Set
$VCDisableSkia = true
in the top of your Podfile, and try rebuilding. - Building without Frame Processors. Set
$VCDisableFrameProcessors = true
in the top of your Podfile, and try rebuilding.
- Building without Skia. Set
- If you're having 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 to find out why. Also make sure you are not using a remote JS debugger such as Google Chrome, since those don't work with JSI.
Android​
- Try cleaning and rebuilding everything:
./android/gradlew clean
rm -rf package-lock.json && rm -rf yarn.lock && rm -rf node_modules
npm i # or "yarn" - Since the Android implementation uses the not-yet fully stable CameraX API, make sure you've browsed the CameraX issue tracker to find out if your issue is a limitation by the CameraX library even I cannot get around.
- 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.gradle
for reference.- Open your
build.gradle
- Set
buildToolsVersion
to33.0.0
or higher - Set
compileSdkVersion
to33
or higher - Set
targetSdkVersion
to33
or higher - Set
minSdkVersion
to21
or higher - Set
ndkVersion
to"23.1.7779620"
or higher - Update the Gradle Build-Tools version to
7.3.1
or higher:classpath("com.android.tools.build:gradle:7.3.1")
- Open your
- Make sure your Gradle Wrapper version is
7.5.1
or higher. Ingradle-wrapper.properties
, set:distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
- If you're having build issues, try:
- Building without Skia. Set
disableSkia = true
in yourgradle.properties
, and try rebuilding. - Building without Frame Processors. Set
disableFrameProcessors = true
in yourgradle.properties
, and try rebuilding.
- Building without Skia. Set
- If you're having 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 logcat
in Terminal. - 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 to find out why. Also make sure you are not using a remote JS debugger such as Google Chrome, since those don't work with JSI.
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.