Bug Report
Originally reported at apache/cordova-plugin-device#125
Problem
If an application has this plugin installed and, for some reason, it's not needed anymore and removed, ondeviceready won't fire anymore.
This seems to be caused by some leftover code... That's probably why the previous reporter mentioned the usual shenanigans of add/remove platform/plugins solved it.
What is expected to happen?
The event should fire as usual, since it's seemingly unrelated to this plugin.
What does actually happen?
ondeviceready never gets fired:

Logcat displays the following (easier to find if you filter logcat by the package name):
2023-10-14 22:59:13.783 29167-29267 PluginManager io.cordova.hellocordova D exec() call to unknown plugin: Device
2023-10-14 22:59:13.834 29167-29167 chromium io.cordova.hellocordova I [INFO:CONSOLE(80)] "[ERROR] Error initializing cordova-plugin-device: Class not found", source: https://localhost/plugins/cordova-plugin-device/www/device.js (80)
2023-10-14 22:59:18.645 29167-29167 chromium io.cordova.hellocordova I [INFO:CONSOLE(1237)] "deviceready has not fired after 5 seconds.", source: https://localhost/cordova.js (1237)
2023-10-14 22:59:18.645 29167-29167 chromium io.cordova.hellocordova I [INFO:CONSOLE(1230)] "Channel not fired: onCordovaInfoReady", source: https://localhost/cordova.js (1230)
Command or Code
$ cordova create sample-reproduction
$ cd sample-reproduction
$ cordova platform add android
$ cordova plugin add cordova-plugin-device
$ cordova plugin rm cordova-plugin-device
$ cordova run android
Environment, Platform, Device
- cordova-android: 12.0.0 and 12.0.1
- plugin: 2.1.0 (as in clean install below), and also our actual project had it installed on 1.1.4, upgraded to 2.1.0, then realized it's not used and thus, got removed. We also removed other plugins and didn't had this kind of trouble.
- device: Android emulator, API 30
Version information
Nothing besides what was described above seems relevant.
Checklist
Bug Report
Problem
If an application has this plugin installed and, for some reason, it's not needed anymore and removed,
ondevicereadywon't fire anymore.This seems to be caused by some leftover code... That's probably why the previous reporter mentioned the usual shenanigans of add/remove platform/plugins solved it.
What is expected to happen?
The event should fire as usual, since it's seemingly unrelated to this plugin.
What does actually happen?
ondevicereadynever gets fired:Logcat displays the following (easier to find if you filter logcat by the package name):
Command or Code
Environment, Platform, Device
Version information
Nothing besides what was described above seems relevant.
Checklist