cordova-cli
cordova-cli copied to clipboard
Edit-Config tag failing
It seems that the edit-config tag fails to find the plist property LSApplicationQueriesSchemes. It throws the error "Error: doc.find is not a function [ERROR] An error occurred while running cordova prepare ios (exit code 1)." when I run $cordova prepare ios. If manually edit my plist file and add the below code, my apps functions fine and I can launch the external apps.
Config.xml
<edit-config file="*-Info.plist" mode="merge" target="LSApplicationQueriesSchemes">
<string>fbapi</string>
<string>fbapi20130214</string>
<string>fbapi20130410</string>
<string>fbapi20130702</string>
<string>fbapi20131010</string>
<string>fbapi20131219</string>
<string>fbapi20140410</string>
<string>fbapi20140116</string>
<string>fbapi20150313</string>
<string>fbapi20150629</string>
<string>fbapi20160328</string>
<string>fbauth</string>
<string>fbauth2</string>
<string>fb-messenger-api20140430</string>
<string>fbapi</string>
<string>fb-messenger-share-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
<string>fb-messenger-platform-20150128</string>
<string>fb-messenger-platform-20150218</string>
<string>fb-messenger-platform-20150305</string>
<string>fb</string>
<string>twitter</string>
<string>linkedin</string>
</edit-config>
Updating Node.js to 18.15.0 fixed this issue for me. Minor version is essential: 18.16.0 gives the same error again.
macOS 13.3.1, Cordova CLI v11.1.0
Another workaround is to use config-file tag instead of edit-config.