cordova-ios
                                
                                 cordova-ios copied to clipboard
                                
                                    cordova-ios copied to clipboard
                            
                            
                            
                        [iOS][Cocoapods] Podfile deployment-target is not updated on cordova prepare
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
- cordova create MyApp
- Edit config.xml and set deployment-target preference
...
  <platform name="ios">
    ...
    <preference name="deployment-target" value="10.0" />
  </platform>
...
- cordova platform add [email protected]
- View platforms/ios/Podfile. The iOS platform will be 10.0
- Remove platformsandpluginsfolders
- Run cordova prepare
- 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
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
I just tested this against cordova-ios 5.1.1. It seems to be working now.
I currently have a similar issue, even with version 5.1.1.
Beside other plugins I'm using ionic's webview which sets the deployment target to 11.0. But if remove and re-add the ios platform, the created Podfile's platform is still set to 10.0.
Only when I remove and re-add any of the plugins with podspecs, the version is updated to 11.0.
Changing the deployment-target in the config.xml does not solve the issue.
Hi all, any update on this?
Using version 5.1.1 the bug appears just with a sample project. I can confirm the behavior described by @rossholdway.
Thanks, Lorenzo
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
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
Hello, same problem here.
- Computer -> MacOS Sonoma 14.2
- Cordova -> [email protected]
- Platform -> [email protected]
- Plugin -> cordova-plugin-device
I reopen my Cordova project 4 months after last time.
Executing a cordova prepare from the Terminal in my Cordova app folder returns:
cd MyApp
cordova prepare                            
CocoaPods was not found. Please install version 1.8.0 or greater from https://cocoapods.org/
I took me one hour to figure out the problems... I didn't find a way to solve it except by removing the deployment-target preference from my config.xml file...
Scenario step by step to reproduce:
cordova create MyApp
cd MyApp
cordova platform add [email protected]
cordova prepare
cordova plugin add cordova-plugin-device
So Far So Good.
Now, I just add <preference name="deployment-target" value="15.0"/> into my config.xml file then I run again a cordova prepare.
Terminal returns: CocoaPods was not found. Please install version 1.8.0 or greater from https://cocoapods.org/
If I remove the deployment-target preference, there is no problem.
Any ideas? Thanks!