You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/06/12 11:12:40 UTC
[GitHub] [cordova-common] dpa99c commented on issue #144: config-file is merged into wrong *-Info.plist when other plugin has podspec.
dpa99c commented on issue #144:
URL: https://github.com/apache/cordova-common/issues/144#issuecomment-643215608
This is still an issue with `cordova-common@4.0.1` / `cordova-ios@6`:
If the app `<name>` in `config.xml` starts with a name which places it before `Pods` in the alphabet, then the issue manifests.
I've created a repo to a reproducible test case: https://github.com/dpa99c/cordova-common-issue-144
It contains 2 test plugins - both of which use a `<podspec>` to add an arbitrary cocoapod to the project and both of which insert values into the app `.plist`.
First clone the repo:
% git clone https://github.com/dpa99c/cordova-common-issue-144 && cd cordova-common-issue-144
Now checkout the branch which contains the app name "Podr" (one letter before "Pods" in the alphabet):
% git checkout Podr
Now let's add `cordova-ios@6` platform:
% cordova platform add ios
And we confirm we're using the expected versions of `cordova-ios` and `cordova-common`:
% npm list cordova-common
helloworld@1.0.0 /projects/@scratch/temp/cordova-common-issue-144
└─┬ cordova-ios@6.0.0
└── cordova-common@4.0.1
We're expecting to see that both our plugins add their entries to the app info plist.
Because our app name is "Podr", our app list will be `platforms/ios/Podr/Podr-Info.plist`.
So if we search for our first plugin entry:
% grep -r "TestPluginA-present" platforms/ios | grep plist
We should see:
platforms/ios/Podr/Podr-Info.plist: <string>TestPluginA-present</string>
Same for our second plugin:
% grep -r "TestPluginB-present" platforms/ios | grep plist
platforms/ios/Podr/Podr-Info.plist: <string>TestPluginB-present</string>
Now checkout the "Podt" branch (one letter after "Pods" in the alphabet)
% git checkout Podt
Remove and re-add the ios platform:
% cordova platform rm ios --nosave && cordova platform add ios --nosave
This time when we search for the first plugin plist entry, the result is unexpected:
% grep -r "TestPluginA-present" platforms/ios | grep plist
platforms/ios/Podt/Podt-Info.plist: <string>TestPluginA-present</string>
platforms/ios/Pods/Target Support Files/Pods-Podt/Pods-Podt-Info.plist: <string>TestPluginA-present</string>
We see it's in both the app plist as expected, but also in the Pods plist.
And the second plugin:
% grep -r "TestPluginB-present" platforms/ios | grep plist
platforms/ios/Pods/Target Support Files/Pods-Podt/Pods-Podt-Info.plist: <string>TestPluginB-present</string>
Is **only** present in the Pods plist - it's missing from the app plist.
To confirm that the `<podspec>` in the first plugin is responsible for this, check out the "plugin-A-no-pods" branch in which the `<podspec>` is commented out in the `plugin.xml` of the first plugin:
% git checkout plugin-A-no-pods
The app name is "Z" on this branch, which of course comes after "Pods" in the alphabet, so we'd expect to see the issue manifest (you can confirm this by checking out the "Z" branch which has the same app name but no commented out `<podspec>`).
Remove and re-add the ios platform:
% cordova platform rm ios --nosave && cordova platform add ios --nosave
As before, the first plugin entry is present in both plists:
% grep -r "TestPluginA-present" platforms/ios | grep plist
platforms/ios/Z/Z-Info.plist: <string>TestPluginA-present</string>
platforms/ios/Pods/Target Support Files/Pods-Z/Pods-Z-Info.plist: <string>TestPluginA-present</string>
But the second plugin entry is now also present in both plists:
% grep -r "TestPluginB-present" platforms/ios | grep plist
platforms/ios/Z/Z-Info.plist: <string>TestPluginB-present</string>
platforms/ios/Pods/Target Support Files/Pods-Z/Pods-Z-Info.plist: <string>TestPluginB-present</string>
This issue is affecting a production project of mine, so I'm keen to find a fix (currently my workaround is to manually move the missing keys from the Pods plist to the app plist).
If I'm able to track down/fix the issue, I'll submit a PR.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org