question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS][Cocoapods] Podfile deployment-target is not updated on cordova prepare

See original GitHub issue

Bug Report

Issue #468 was recently fixed, however the deployment-target preference only applies if you run cordova plugin add ... and not when running cordova prepare.

Problem

cordova prepare does not update the Podfile with the value specified in the config.xml deployment-target prefrence.

What is expected to happen?

The Podfile should contain the value specified in the config.xml deployment-target preference after running cordova prepare.

What does actually happen?

The Podfile is not updated with the value specified

Steps to reproduce

  1. cordova create MyApp
  2. Edit config.xml and set deployment-target preference
...
  <platform name="ios">
    ...
    <preference name="deployment-target" value="10.0" />
  </platform>
...
  1. cordova platform add ios@5.0.0
  2. View platforms/ios/Podfile. The iOS platform will be 10.0
  3. Remove platforms and plugins folders
  4. Run cordova prepare
  5. View platforms/ios/Podfile. The iOS platform will be 9.0. I’d expect it to be 10, as specified in config.xml

Version information

Cordova iOS v5.0.0 Cordova CLI v9.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

1reaction
jaybowmancommented, Dec 17, 2020

I’m still having this issue. I created a new cordova app and I have a custom plugin that uses podspec. using cordova-ios 6.1.1, cordova 10.0.0 using the config.xml deployment-target perferance value = 12.2 does not update the pod file when I do “cordova platform add ios” it is defaulting to ‘11.0’ and my pod framework has a minimum ios deployment target of 12. My plugin list: cordova-plugin-add-swift-support cordova-plugin-app-launcher cordova-plugin-device cordova-plugin-whitelist

0reactions
jacobgcommented, Dec 27, 2021

I’m also running into this issue. I’ll have to check if a build hook can add a pod post-install script to work around this bug: https://stackoverflow.com/a/37289688/1237919

Read more comments on GitHub >

github_iconTop Results From Across the Web

ios - CocoaPods could not find compatible versions for pod ...
My setup: VS Code, Flutter. If you don't have Podfile.lock file and pod update doesn't help, try this: Go to ios/Pods/Local Podspecs ...
Read more >
Ionic iOS build process failing
It appears that the cocoapods install, or something related to it, is causing the problem. Running pod install --verbose. in the /ios/app folder ......
Read more >
Fixing `The iOS Simulator deployment target ... - wafrat
To regenerate the Podfile, run: rm ios/Podfile Error launching application on iPhone 13. Exited (sigterm). Seems like a simple way to update ......
Read more >
Add Firebase to your Apple project
For apps that use CocoaPods, the Firebase pod is deprecated in v9.0 and higher. Instead, you need to reference product pods directly in...
Read more >
[Solved]-File Transfer Download with Cordova 3.4 for iOS 7
Coding example for the question File Transfer Download with Cordova 3.4 for ... not working after update to Swift 3 · React Native...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found