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 13:35:44 UTC

[GitHub] [cordova-common] jamesyoon11 opened a new issue #144: config-file is merged into wrong *-Info.plist when other plugin has podspec.

jamesyoon11 opened a new issue #144:
URL: https://github.com/apache/cordova-common/issues/144


   # Bug Report
   
   The config-file in plug.xml is merged into wrong *-info.plist when it has installed Pods.
   
   Here is the step to reproduce
   
   ```
   npx cordova create SampleApp com.sample.app SampleApp
   cd SampleApp/
   npx cordova platform add ios
   npx cordova plugin add cordova-plugin-facebook4
   npx cordova plugin add cordova-plugin-background-mode
   ```
   
   cordova-plugin-facebook4 installs [cocoaPods Facebook SDK](https://github.com/jeduan/cordova-plugin-facebook4/blob/master/plugin.xml#L164).
   
   cordova-plugin-background-mode has [UIBackgroundMode config-file](https://github.com/katzer/cordova-plugin-background-mode/blob/master/plugin.xml#L44):
   
   ```xml
   <config-file target="*-Info.plist" parent="UIBackgroundModes">
               <array>
                   <string>audio</string>
               </array>
   </config-file>
   ```
   
   It should have merged into SampleApp-Info.plist but it merged into Pods/Target Support Files/Pods-SampleApp/Pods-SampleApp-Info.plist.
   
   ![Screen Shot 2020-05-13 at 3 10 13 PM](https://user-images.githubusercontent.com/13875691/81871228-3b0c8f80-952c-11ea-9cd5-0fcc9f13e99b.png)
   
   
   However, if the project name is lower than 'Pods' (ex 'MyApp'), the issue does not happen.
   
   


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


[GitHub] [cordova-common] EvelinJK commented on issue #144: config-file is merged into wrong *-Info.plist when other plugin has podsec.

Posted by GitBox <gi...@apache.org>.
EvelinJK commented on issue #144:
URL: https://github.com/apache/cordova-common/issues/144#issuecomment-639436792


   This should theoretically have been fixed with version `4.0.0`, released on March 26th, 2020.
   See "GH-124" here: https://cordova.apache.org/announcements/2020/03/30/cordova-common-release-4.0.0.html
   
   It only happens if you use CocoaPods version greater 1.6.
   
   When the target for the config.xml is specified as `*-Info.plist` and your app name starts with a letter that comes after "P", it will find the wrong .plist file and write into that instead of the correct one. That's because there's also a  "YourProjectName-Info.plist" in the "Pods" folder, which will be found first in this case.
   
   Also see the issue where the bug was originally identified: https://github.com/apache/cordova-common/issues/88 
   
   


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


[GitHub] [cordova-common] EvelinJK edited a comment on issue #144: config-file is merged into wrong *-Info.plist when other plugin has podsec.

Posted by GitBox <gi...@apache.org>.
EvelinJK edited a comment on issue #144:
URL: https://github.com/apache/cordova-common/issues/144#issuecomment-639436792


   This should theoretically have been fixed with version `4.0.0`, released on March 26th, 2020.
   See "GH-124" here: https://cordova.apache.org/announcements/2020/03/30/cordova-common-release-4.0.0.html
   
   It only happens if you use CocoaPods version greater 1.6.
   
   When the target is specified as `*-Info.plist` and your app name starts with a letter that comes after "P", it will find the wrong .plist file and write into that instead of the correct one. That's because there's also a  "YourProjectName-Info.plist" in the "Pods" folder, which will be found first in this case.
   
   Also see the issue where the bug was originally identified: https://github.com/apache/cordova-common/issues/88 
   
   


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


[GitHub] [cordova-common] raphinesse commented on issue #144: config-file is merged into wrong *-Info.plist when other plugin has podsec.

Posted by GitBox <gi...@apache.org>.
raphinesse commented on issue #144:
URL: https://github.com/apache/cordova-common/issues/144#issuecomment-639488989


   @jamesyoon11 As @EvelinJK mentioned, this should be fixed in `cordova-common@4.0.0`. Now I am not sure if `cordova-lib` or `cordova-ios` performs the merging. So could you try and see if you can reproduce the bug using `cordova@nightly` and `cordova-ios@6` (or nightly too)?


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


[GitHub] [cordova-common] dpa99c commented on issue #144: config-file is merged into wrong *-Info.plist when other plugin has podspec.

Posted by GitBox <gi...@apache.org>.
dpa99c commented on issue #144:
URL: https://github.com/apache/cordova-common/issues/144#issuecomment-643280523


   The above PR fixes this issue. To confirm, run the following test (continuing on from my test scenarios above):
   
   	% git checkout Podt-fixed
   
   
   This checks out a branch where the app name is still "Podt" but it references my [fork of `cordova-ios`](https://github.com/dpa99c/cordova-ios) which in turn references [my fork on `cordova-common`](https://github.com/dpa99c/cordova-common/tree/GH-144) which contains [the fix](https://github.com/dpa99c/cordova-common/commit/c9afe77ab2b004f87a0426753a58a4aaaf0aded4).
   
   Re-add the platform using my fork:
   
   	% cordova platform rm ios --nosave && cordova platform add ios --nosave
   
   
   Now search for the plugin plist strings:
   
   	% grep -r "TestPluginA-present" platforms/ios | grep plist
   	platforms/ios/Podt/Podt-Info.plist:	<string>TestPluginA-present</string>
   	
   	% grep -r "TestPluginB-present" platforms/ios | grep plist
   	platforms/ios/Podt/Podt-Info.plist:	<string>TestPluginB-present</string>
   
   They are now in the expected app plist location.


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


[GitHub] [cordova-common] dpa99c commented on issue #144: config-file is merged into wrong *-Info.plist when other plugin has podspec.

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [cordova-common] dpa99c commented on issue #144: config-file is merged into wrong *-Info.plist when other plugin has podspec.

Posted by GitBox <gi...@apache.org>.
dpa99c commented on issue #144:
URL: https://github.com/apache/cordova-common/issues/144#issuecomment-643273934


   Oops, that was implicit - didn't mean to close without review


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


[GitHub] [cordova-common] dpa99c closed issue #144: config-file is merged into wrong *-Info.plist when other plugin has podspec.

Posted by GitBox <gi...@apache.org>.
dpa99c closed issue #144:
URL: https://github.com/apache/cordova-common/issues/144


   


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


[GitHub] [cordova-common] dpa99c closed issue #144: config-file is merged into wrong *-Info.plist when other plugin has podspec.

Posted by GitBox <gi...@apache.org>.
dpa99c closed issue #144:
URL: https://github.com/apache/cordova-common/issues/144


   


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