apache / cordova-plugin-device

Apache Cordova Device Plugin
https://cordova.apache.org/
Apache License 2.0
387 stars 428 forks source link

cordova-plugin-device@2.1.0 breaks existing projects that (npm tilde) reference ^2.x.x and use Cordova versions < 9 #169

Closed hexagon-ecosys closed 2 years ago

hexagon-ecosys commented 2 years ago

Bug Report

Problem

cordova-plugin-device@2.1.0 breaks existing projects that (npm caret) reference ^2.x.x and use Cordova versions < 9

What is expected to happen?

cordova-plugin-device@2.1.0 should not break existing projects that (npm caret) reference ^2.x.x and use Cordova versions < 9

What does actually happen?

Installing "cordova-plugin-device" for android Failed to restore plugin "cordova-plugin-device" from config.xml. You might need to try adding it again. Error: code: engine.platform or engine.scriptSrc is not defined in custom engine "cordova-electron" from plugin "cordova-plugin-device" for android warn

Information

Clone https://github.com/hexagon-ecosys/cordova812-helloWorld and follow its README

Command or Code

cordova prepare

Environment, Platform, Device

Version information

node 16.14.2 npm 8.5.0 cordova 8.1.2

This is probably not a supported configuration, but hopefully this bug helps someone else.

There are a couple of solutions -

  1. hard-set the reference to 2.0.3 to NOT pull the electron support related changes introduced in 2.1.0.
  2. Upgrade Cordova to at least 9. I tested 9.0.0, 10.0.0 and 11.0.0 where this problem is not reproducible.

Checklist

breautek commented 2 years ago

use Cordova versions < 9

This cordova cli version is out of support. Generally speaking we don't support or provide backports to older releases. We only move forward.

For that reason, I'm closing this issue as won't fix. It's If my understanding that this issue is not reproducible on the current stable releases. If I'm wrong, please let us know and we can reopen this issue, or open a new ticket.

Kind regards, Norman