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

Platform Add Failed on iOS project #908

Closed
5 tasks done
Delagen opened this issue Nov 18, 2024 · 3 comments · Fixed by #909
Closed
5 tasks done

Platform Add Failed on iOS project #908

Delagen opened this issue Nov 18, 2024 · 3 comments · Fixed by #909

Comments

@Delagen
Copy link

Delagen commented Nov 18, 2024

Bug report

CHECKLIST

  • I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
  • I have checked that no similar issues (open or closed) already exist.

Current behavior:

Failed to install 'cordova-plugin-firebasex': TypeError: Cannot read properties of undefined (reading 'indexOf')
    at Utilities.getAppName (/Users/delagen/mobile-app/cordova/plugins/cordova-plugin-firebasex/scripts/lib/utilities.js:70:32)
    at Object.getXcodeProjectPath (/Users/delagen/mobile-app/cordova/plugins/cordova-plugin-firebasex/scripts/ios/helper.js:65:33)
    at module.exports (/Users/delagen/mobile-app/cordova/plugins/cordova-plugin-firebasex/scripts/ios/after_plugin_install.js:7:35)
    at runScriptViaModuleLoader (/Users/delagen/mobile-app/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:159:32)
    at runScript (/Users/delagen/mobile-app/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:138:12)
    at /Users/delagen/mobile-app/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:110:40
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

Expected behavior:
No errors

Steps to reproduce:

cordova platform rm ios --no-save
cordova platform add ios --no-save

Screenshots

Environment information

  • Cordova CLI version
    • 12.0.0
  • Cordova platform version
    • ios 7.1.1
  • Plugins & versions installed in project (including this plugin)
    cordova-plugin-add-swift-support 2.0.2 "AddSwiftSupport"
    cordova-plugin-advanced-http 3.3.1 "Advanced HTTP plugin"
    cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
    cordova-plugin-browser 1.0.0 "BrowserPlugin"
    cordova-plugin-customurlscheme 5.0.2 "Custom URL scheme"
    cordova-plugin-device 3.0.0 "Device"
    cordova-plugin-dialogs 2.0.2 "Notification"
    cordova-plugin-file 8.1.2 "File"
    cordova-plugin-firebasex 18.0.2 "Google Firebase Plugin"
    cordova-plugin-inappbrowser 6.0.0 "InAppBrowser"
    cordova-plugin-localization-strings 5.0.5 "Localization"
    cordova-plugin-qrscanner 3.0.1 "QRScanner"
    cordova-plugin-screen-orientation 3.0.4 "Screen Orientation"
    cordova-plugin-statusbar 4.0.0 "StatusBar"
  • Dev machine OS and version, e.g.
    • OSX
      • 15.1.0

iOS build issue:

  • Node JS version
    • 22.11.0
  • XCode version

Other information:
Seems https://github.com/dpa99c/cordova-plugin-firebasex/blob/master/scripts/lib/utilities.js#L69 should be corrected as
if(_context.opts.**cordova**.platforms.indexOf('ios') !== -1){

Delagen pushed a commit to Delagen/cordova-plugin-firebasex that referenced this issue Nov 18, 2024
Delagen pushed a commit to Delagen/cordova-plugin-firebasex that referenced this issue Nov 18, 2024
@Delagen
Copy link
Author

Delagen commented Nov 18, 2024

Created PR

dpa99c added a commit that referenced this issue Nov 18, 2024
(cordova): fix invalid cordova hook interface use, fix #908
@dpa99c
Copy link
Owner

dpa99c commented Nov 18, 2024

Thanks, I have merged it.
Upon testing it, _context.opts.platforms does actually exist on subsequent cordova prepare ios operations but not during cordova platform add ios.
Whereas _context.opts.cordova.platforms exists during both.

@dpa99c
Copy link
Owner

dpa99c commented Nov 18, 2024

Fix published in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants