apache / cordova-osx

[DEPRECATED] Apache Cordova OSX

Home Page:https://cordova.apache.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cordova-osx@6.0.0 / Cordova CLI 10 fails to restore plugins from package.json

alalamav opened this issue · comments

Bug Report

Problem

What is expected to happen?

cordova-osx should restore plugins from package.json when running cordova platform add osx. The plugins' native and JS code should run before the deviceready event is fired.

What does actually happen?

Plugins declared in package.json are successfully added to the native macOS (Xcode) project, but their code is not run. As a result, the WebView is not able to access exported definitions (i.e. window.device for cordova-plugin-device).

Information

  • When restoring plugins from package.json:
    • the last installed plugin overrides existing configurations in platforms/osx/www/cordova_plugins.js
    • platforms/osx/cordova-macos-test/config.xml and platforms/osx/osx.json are missing plugin declarations.
  • Manually removing and adding plugins successfully configures them to run.
  • Note that this issue does not occurr in cordova-osx@5.0.0 (or cordova-ios@6.*).

Command or Code

Please see alalamav/cordova-macos-test for a detailed description of the problem and reproduction steps.

Environment, Platform, Device

macOS

Version information

  • cordova-cli@10.0.0
  • cordova-osx@6.0.0
  • macOS 10.15.3
  • Xcode 11.6

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

I have seen this issue with my cordova-sqlite-storage "spec" test app when using Cordova CLI 10, seems to go away when I switch to Cordova CLI 9 regardless of cordova-osx version 5 vs 6. I have updated the title and confirmed this as a bug with help wanted.

P.S. I have also observed that after cordova platform add osx, cordova prepare osx is needed before I can build and run from Xcode. I hope we can get this fixed as well.

UPDATE January 2022: still seems to be an issue with Cordova CLI 11

How do we even debug this? I don't have experience developing the cordova platforms and have no idea where to look to find the issue.

We are archiving this repository following Apache Cordova's Deprecation Policy. We will not continue to work on this repository. Therefore all issues and pull requests are being closed. Thanks for your contribution.