React Native Expo set minimum iOS Deployment Target for Podfiles
Asked Answered
L

3

6

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.

Lenka answered 31/10, 2023 at 16:55 Comment(0)
E
3

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

Easter answered 19/3, 2024 at 19:24 Comment(0)
L
2

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.

Lenka answered 2/11, 2023 at 11:4 Comment(0)
C
0

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
Condenser answered 31/10, 2023 at 17:25 Comment(2)
Yeah I recently just saw some people with similar suggestions elsewhere. I have tried simply changing the target to 13.0 for all, checking the current value and setting it to 13.0 if it is not valid, or just deleting the value altogether. Neither actually reflected changes in Xcode.Lenka
This is the correct way to set IPHONEOS_DEPLOYMENT_TARGET 13 so it will not update your Xcode IPHONEOS_DEPLOYMENT_TARGET whenever you install podBethesda

© 2022 - 2025 — McMap. All rights reserved.