cordova-ios: Podspec tag does not generate podfile

Bug Report

Problem

What is expected to happen?

Noticed this warning in customers’ apps: "framework" tag with type "podspec" is deprecated and will be removed. Please use the "podspec" tag. Updated my plugin’s plugin.xml with podspec tag instead of framework tag and installed the plugin. Podfile should be created and filled with referenced frameworks, pods should be installed.

What does actually happen?

Podfile is created but it is empty. No Pods folder inside platforms/ios.

STR

  1. plugin.xml:
...

<platform name="ios">
    ...

    <podspec>
         <config>
             <source url="https://github.com/CocoaPods/Specs.git"/>
         </config>
         <pods use-frameworks="true">
             <pod name="AppCenter" spec="~> 2.0.1" />
         </pods>
    </podspec>
</platform>
  1. Add my local plugin into the test app’s config: <plugin name="my-cordova-plugin" spec="file:../my-cordova-plugin" />

  2. Run cordova platform add ios

  3. Observe the Podfile inside platforms/ios:

# DO NOT MODIFY -- auto-generated by Apache Cordova

platform :ios, '9.0'

target 'TestApp' do
	project 'TestApp.xcodeproj'

end

Environment, Platform, Device

macOS High Sierra

Version information

cocoapods 1.6.0 cordova-ios 5.0.1 node 10.15.1 cordova-lib 8.1.2 (and 9.0.2 as well has that error)

dsymutil -v
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  Optimized build.
  Default target: x86_64-apple-darwin17.7.0
  Host CPU: ivybridge

Checklist

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

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 24 (10 by maintainers)

Most upvoted comments

@janpio can somebody please take a look at this? We really want to be able to update deprecated tags 🙂

Looking at the update,

cordova-lib 8.1.2 (and 9.0.2 as well has that error)

I suspect you are still using an older version of Cordova CLI, based from the lib version. Also, there is currently no 9.0.2 cordova-lib release.

The new pod tags were introduced in Cordova CLI 9.x.

First, could you try and upgrade your Cordova CLI?

npm uninstall -g cordova
npm install -g cordova@latest

$ cordova -v
9.0.0 (cordova-lib@9.0.1)

Also, for adding plugins, I would recommend using the Cordova command: cordova plugin add /path/to/plugin. Cordova CLI 9.x also manages plugins now in pacakge.json and no longer adds plugins to the config.xml

You could possibly add it manually to the devDependencies in package.json.

Example:

"devDependencies": {
  "cordova-ios": "^5.0.1",
  "cordova-plugin-appcenter": "file:../../../../tmp/test-plugin"
},