Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple-osx engine version undefined when installing plugin #392

Closed
tomasszabo opened this issue Dec 17, 2018 · 2 comments
Closed

Apple-osx engine version undefined when installing plugin #392

tomasszabo opened this issue Dec 17, 2018 · 2 comments
Labels
bug info-needed We need more information from the reporter

Comments

@tomasszabo
Copy link

I've a plugin which defines engine apple-osx

 <engine name="apple-osx" version=">=10.14.0" />

but when installing such plugin for 2 platforms (iOS and OSX) I receive following error

Failed to install 'cordova-plugin-local-notification': TypeError: Invalid Version: undefined
at new SemVer (/Users/tomec/.nvm/versions/node/v10.8.0/lib/node_modules/cordova/node_modules/semver/semver.js:305:11)
at Range.test (/Users/tomec/.nvm/versions/node/v10.8.0/lib/node_modules/cordova/node_modules/semver/semver.js:1112:15)
at Function.satisfies (/Users/tomec/.nvm/versions/node/v10.8.0/lib/node_modules/cordova/node_modules/semver/semver.js:1161:16)
at checkEngines (/Users/tomec/.nvm/versions/node/v10.8.0/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:116:20)
at /Users/tomec/.nvm/versions/node/v10.8.0/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:313:16
at _fulfilled (/Users/tomec/.nvm/versions/node/v10.8.0/lib/node_modules/cordova/node_modules/q/q.js:854:54)
at /Users/tomec/.nvm/versions/node/v10.8.0/lib/node_modules/cordova/node_modules/q/q.js:883:30
at Promise.promise.promiseDispatch (/Users/tomec/.nvm/versions/node/v10.8.0/lib/node_modules/cordova/node_modules/q/q.js:816:13)
at /Users/tomec/.nvm/versions/node/v10.8.0/lib/node_modules/cordova/node_modules/q/q.js:624:44
at runSingle (/Users/tomec/.nvm/versions/node/v10.8.0/lib/node_modules/cordova/node_modules/q/q.js:137:13)

Error is due to currentVersion: 'undefined' in parsed engine

{ 
    platform: 'ios',
    scriptSrc: '/Users/tomec/Projects/CordovaTest/platforms/ios/cordova/apple_osx_version',
    minVersion: '>=10.14.0',
    currentVersion: 'undefined',
    name: 'apple-osx' 
}

I've located problem down to script lib/versions.js which is called from script apple_osx_version. The problem is due to invalid RegEx var regexOSX = /^OS X \d+/; because now the output from xcodebuild -showsdks looks following:

macOS SDKs:
    macOS 10.14                   	-sdk macosx10.14

Changing RegEx to var regexOSX = /^macOS \d+/;fixed the problem.


Node version: v10.8.0
Cordova version: 8.1.1

@raphinesse
Copy link
Contributor

Could you please provide a link to the file you are talking about. Or even better, create a Pull Request with the fix in the respective repository?

@raphinesse raphinesse added bug info-needed We need more information from the reporter labels Apr 11, 2019
@dpogue
Copy link
Member

dpogue commented Jun 18, 2024

This appears to be resolved in newer versions of cordova-ios (albeit the currently released version of cordova-ios will skip those checks because of apache/cordova-ios#1415)

@dpogue dpogue closed this as completed Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug info-needed We need more information from the reporter
Projects
None yet
Development

No branches or pull requests

3 participants