blakgeek / cordova-plugin-cocoapods-support

A Cordova/PhoneGap plugin to add support for CocoaPods dependencies.
MIT License
72 stars 72 forks source link

Plugin messes up `platforms/ios/cordova/lib/build.js` #23

Closed botverse closed 7 years ago

botverse commented 7 years ago

EDIT: cordova version installed 6.4.0, cordova-ios platform version installed 4.3.1, also tried with 4.4.0

This is how to reproduce the error

cordova create pod-test
cd pod-test/
cordova platform add ios --save
# this command succeeds 
cordova build ios
# this is currently 1.2.11 but I have also tried with 1.2.10
cordova plugin add https://github.com/blakgeek/cordova-plugin-cocoapods-support.git --save
# this command fails
cordova build ios --verbose

This is the error returned

Error: SyntaxError: Unexpected number
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at /Users/fonz/Desktop/pod-test/platforms/ios/cordova/Api.js:417:16
    at _fulfilled (/Users/fonz/Desktop/pod-test/platforms/ios/cordova/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/Users/fonz/Desktop/pod-test/platforms/ios/cordova/node_modules/q/q.js:863:30)

Because this is syntactically incorrect, notice the quotes.

options = [
    '-xcconfig', customArgs.xcconfig || path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'),
    '-workspace', customArgs.project || projectName + '.xcworkspace',
    '-scheme', customArgs.scheme || projectName,
    '-configuration', customArgs.configuration || configuration,
    '-sdk', customArgs.sdk || 'iphonesimulator',
    '-destination generic/platform=iOS',name=iPhone 5s'
];