React Native: what to set minimum deployment target to?
Asked Answered
C

2

5

I'm trying to add react-native-vision-camera to my React Native app, and it gave me the following error:

Specs satisfying the VisionCamera (from ../node_modules/react-native-vision-camera) dependency were found, but they required a higher minimum deployment target.

In my podfile I have platform :ios, '10.0'. Is there a way to find the minimum deployment target that this library requires? And is there ever a disadvantage to increasing the minimum deployment target?

Cologarithm answered 11/8, 2022 at 18:4 Comment(0)
E
5

As of V3, the react-native-vision-camera example project follows the iOS minimum target of React Native. You can see that in the Podfile here: https://github.com/mrousavy/react-native-vision-camera/blob/main/package/example/ios/Podfile:

platform :ios, min_ios_version_supported

The value for that variable is in the react-native scripts folder: https://github.com/facebook/react-native/blob/b0982971c6ed6be98b99db902a38dfdf5e9b8b37/packages/react-native/scripts/cocoapods/helpers.rb#L40. The value below is for React Native 73.0:

        def self.min_ios_version_supported
            return '13.4'
        end

The disadvantage of increasing the minimum target is that your app won't work on devices that can't upgrade to your minimum OS version. Supporting two OS versions behind the latest major release is pretty common.

You can check Apple's compatibility chart here: https://support.apple.com/en-us/HT209574

Anything older than those devices won't work.

Erythrism answered 11/8, 2022 at 18:58 Comment(3)
The link https://github.com/mrousavy/react-native-vision-camera/blob/main/example/ios/Podfile ends in 404 Not Found. Would you mind adding the code of that link you shared in your answer? Thank you.Agni
Ah, looks like they changed some things. Thanks, updated answerErythrism
React Native 0.76 is minimum 15.1. Source and announcement.Implicatory
H
1

Open your iOS project in Xcode and then follow these steps:

steps

Hexahydrate answered 11/8, 2022 at 18:31 Comment(1)
thanks for your reply. I do know to change the target. My two questions were slightly different though ^^Cologarithm

© 2022 - 2024 — McMap. All rights reserved.