Current behavior:
If app name has single quote character (for example "Acme'" , iOS platform cannot be added.
Expected behavior:
iOS platform could be added.
Steps to reproduce:
cordova create Acme com.acme.ltd "Acme'"
cd Acme/
cordova plugin add cordova-plugin-firebasex
cordova platform add ios@latest
Environment information
_iOS build issue:_
Other information:
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.acme.ltd
Name: Acme'
iOS project created with [email protected]
Installing "cordova-plugin-firebasex" for ios
Installing "cordova-plugin-androidx" for ios
Installing "cordova-plugin-androidx-adapter" for ios
Running command: pod install --verbose
Failed to install 'cordova-plugin-firebasex': Error: pod: Command failed with exit code 1
at ChildProcess.whenDone (/work/App25/Acme/node_modules/cordova-common/src/superspawn.js:135:23)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:557:12)
pod: Command failed with exit code 1
This is caused because Cordova uses the exact project name to create the underlying Xcode project and the apostrophe causes Cocoapods to fail to install the Pods:
cordova platform add android --verbose
...
Running command: pod install --verbose
==== pod install start ====
Preparing
Analyzing dependencies
[!] The target `Acme'` is declared multiple times for the project `Acme'.xcodeproj`.
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.2/lib/cocoapods/installer/analyzer.rb:219:in `validate_podfile!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.2/lib/cocoapods/installer/analyzer.rb:97:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:398:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:221:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.2/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:220:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.2/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.2/lib/cocoapods/command/install.rb:51:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.2/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.2/bin/pod:55:in `<top (required)>'
/usr/local/Cellar/cocoapods/1.5.3/libexec/bin/pod:22:in `load'
/usr/local/Cellar/cocoapods/1.5.3/libexec/bin/pod:22:in `<main>'
Command finished with error code 1: pod install,--verbose
Failed to install 'cordova-plugin-firebasex': Error: pod: Command failed with exit code 1
at ChildProcess.whenDone (/Users/dave/Documents/projects/@scratch/Acme/node_modules/cordova-common/src/superspawn.js:135:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
This will happen if you use an apostrophe in a Cordova project name and install any plugin that uses Cocoapods to install dependencies.
The answer: don't use an apostrophe in your project name.
There's nothing this plugin can do to resolve the issue with Cocoapods so closing this as out of scope.
Most helpful comment
This is caused because Cordova uses the exact project name to create the underlying Xcode project and the apostrophe causes Cocoapods to fail to install the Pods:
This will happen if you use an apostrophe in a Cordova project name and install any plugin that uses Cocoapods to install dependencies.
The answer: don't use an apostrophe in your project name.
There's nothing this plugin can do to resolve the issue with Cocoapods so closing this as out of scope.