Device ready not firing on android

Not sure if this is a capacitor issue or an ionic issue but platform ready isn’t firing on Android in Emulators or a real device. It fires fine on iOS.

I’m guessing this big error has something to do with it:

2020-06-19 22:09:08.669 30272-30490/appIdentifier E/PluginManager: Uncaught exception from plugin
    android.content.res.Resources$NotFoundException: String resource ID #0x0
        at android.content.res.Resources.getText(Resources.java:339)
        at android.content.res.Resources.getString(Resources.java:433)
        at android.content.Context.getString(Context.java:556)
        at com.ionicframework.common.IonicCordovaCommon.getStringResourceByName(IonicCordovaCommon.java:341)
        at com.ionicframework.common.IonicCordovaCommon.getNativeConfig(IonicCordovaCommon.java:425)
        at com.ionicframework.common.IonicCordovaCommon.getPreferences(IonicCordovaCommon.java:384)
        at com.ionicframework.common.IonicCordovaCommon.execute(IonicCordovaCommon.java:92)
        at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
        at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
        at com.getcapacitor.MessageHandler.callCordovaPluginMethod(MessageHandler.java:69)
        at com.getcapacitor.MessageHandler.postMessage(MessageHandler.java:45)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:325)
        at android.os.Looper.loop(Looper.java:142)
        at android.os.HandlerThread.run(HandlerThread.java:65)

and

2020-06-19 22:09:07.498 30272-30272/appIdentifier D/Capacitor: Registering plugin: Device
2020-06-19 22:09:13.362 30272-30272/appIdentifier I/Capacitor/Console: File: capacitor-runtime.js - Line 2188 - Msg: deviceready has not fired after 5 seconds.
2020-06-19 22:09:14.070 30272-30272/appIdentifier W/Capacitor/Console: File: http://localhost/main-es2015.05060ed6cc850a2d43a7.js - Line 1 - Msg: Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.

I can’t workout where to delete the plugins from as the last line says and I don’t want to remove the platform as I will loose some set up that I have done and will need to re-add keys etc.

Any clues on where to go? I’ve upgraded to capacitor latest so on 2.2.0, I’ve re sync’d the project as well and no change. One one emulator it just doesn’t even load.

Were you able to fix this by any chance? I’m getting the same error.

Did you ever resolve this? I have the same error after upgrading a cordova project to capacitor?

EDIT (issue resolved):

I managed to resolve this, my issue was caused by missing parameters in the “…\android\app\src\main\res\values\strings.xml” file within the Android project, the one in particular it seemed to be failing on was the “ionic_max_versions”.

These are variables relating to “Ionic Deploy”. I resolved the issue by running the following commands:

ionic link ${your_app_id}
ionic deploy add

This added the required strings for “Ionic Deploy” to the “strings.xml” file mentioned above after Capacitor had synced.

I’ve been pulling my hair out over an issue with my Ionic app on Android, and I could really use some help. I’ve noticed that the device ready event isn’t firing consistently on my Android device, which is causing some major headaches for me. I’ve double-checked my code and made sure everything is set up correctly. I’m using the standard document.addEventListener(‘deviceready’, callback) approach to listen for the event. It works like a charm on iOS, but when it comes to Android, it seems unreliable…