React Native Expo set minimum iOS Deployment Target for Podfiles

2.1k views Asked by At

I am trying to build my React Native app for iOS and having issues.

I build on a regular basis, but since upgrading Xcode to 15.0.1, I have run into an issue.

I build my app for iOS as follows:

  • npx expo prebuild -> generates my ios and android folders
  • cd ios
  • pod install
  • Open the ios directory in Xcode and configure my signing and build settings
  • Create a Gymfile in the ios directory with the necessary details
  • fastlane gym
  • This then gives me my .ipa file which I then upload to TestFlight

However, since the upgrade, when I run fastlane gym, it fails, with multiple logs relating to my Podfiles targeting an invalid version of iOS, these look like this:

warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to ...

I have tried various things to resolve this, including changes to my Podfile, and setting the platform :ios, to be podfile_properties['ios.deploymentTarget'] if the value exists and is greater or equal to 12.0, else set it to 12.0.

I also tried manually changing the deployment target in each of the Pods in Xcode, but I have not had any success yet.

I also tried adding:

"plugins": [
  [
    "expo-build-properties",
    {
      "ios": {
        "deploymentTarget": "13.0"
      }
    }
  ]
],

to my app.config.js, but this also didn't fix my issue.

3

There are 3 answers

3
Shivo'ham On

You can also update it on each pod using a post_install hook, something like this:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
    end
  end
end

After adding the above code execute the below command

pod install
npx expo prebuild --clean
0
TreyBCollier On

I have managed to solve my issue by upgrading to Expo 49, I was previously using Expo 47. My iOS builds now succeed, although my Android builds have started to fail.

0
klamm On

After running npx expo install --fix, I was able to build