cordova-ios icon indicating copy to clipboard operation
cordova-ios copied to clipboard

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

Open rossholdway opened this issue 6 years ago • 5 comments

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 [email protected]
  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

  • [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

rossholdway avatar Mar 25 '19 16:03 rossholdway

I just tested this against cordova-ios 5.1.1. It seems to be working now.

frenmanoj avatar Feb 06 '20 19:02 frenmanoj

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.

th3hamm0r avatar Mar 25 '20 17:03 th3hamm0r

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

flexaddicted avatar Apr 08 '20 16:04 flexaddicted

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

jaybowman avatar Dec 17 '20 18:12 jaybowman

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

jacobg avatar Dec 27 '21 20:12 jacobg

Hello, same problem here.

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!

Faksprod avatar Dec 14 '23 14:12 Faksprod