danielehrhardt / cordova-plugin-extended-device-information

7 stars 8 forks source link

Ionic Native: deviceready did not fire within 5000ms. #3

Closed abudarevsky closed 6 years ago

abudarevsky commented 6 years ago

When plugin is installed it prevents android app from start. It happens even plugin would not registered on app.module.ts. Cordova platform version android@~6.3.0. Target Android version 7.0, Samsung Galaxy S7

[16:50:43] console.log: Device Data [object Object] [16:50:51] console.log: [Logging message of provider created two ReplaySubject instances] [16:50:51] console.log: deviceready has not fired after 5 seconds. [16:50:51] console.log: Channel not fired: onCordovaInfoReady [16:50:51] console.warn: 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.

danielehrhardt commented 6 years ago

Could you try ionic cordova plugin add cordova-plugin-extended-device-information@2.1.5 and before remove it

abudarevsky commented 6 years ago

Makes no difference as initially it was installed 2.1.5. I changed cordova platform to 6.4.0 - the same effect. cordova 7.1.0 is not working for me yet (minSdkVersion mismatch)

M-Rizk commented 6 years ago

Hi There, I have the same issue, any updates?

doncabron commented 6 years ago

Are there any updates on this issue?

danielehrhardt commented 6 years ago

Could someone post the config.xml

doncabron commented 6 years ago

Hey Daniel!

I updated all plugin dependencies to the most recent available ones. I get the Device Data console.log output in LogCat but then just this:

[INFO:CONSOLE(173013)] "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.", source: file:///android_asset/www/build/vendor.js (173013)

config.txt

Let me know, if you need some other information.

EDIT: I should add, that I ran it inside platform.ready(), if I run it outside of it, I get this - even though the plugin is installed properly:

[INFO:CONSOLE(74688)] "Native: tried calling ExtendedDeviceInformation.memory, but the ExtendedDeviceInformation plugin is not installed.", source: file:///android_asset/www/build/vendor.js (74688)

danielehrhardt commented 6 years ago

It is a common thing. I think this is not because my plugin has an issue.

https://forum.ionicframework.com/t/ionic-native-deviceready-did-not-fire-within-5000ms/119283/6

doncabron commented 6 years ago

I tried several approaches. The app never loads (neither in dev or prod compilation), when I have the plugin added to the app. Only by removing the plugin the app starts up.

AUK4GIT commented 6 years ago

Hi Daniel, Even my app doesn't load properly after installing the plugin. I have tried with release 2.1.4 and 2.1.5 as well. I know this plugin is not intended for iOS, but I see that the iOS app also doesn't load properly and the xcode log shows "ERROR: Plugin 'ExtendedDevice' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml."

nomarlo commented 6 years ago

Hi Daniel,

Even when the app could load and the message would look only annoying, actually brokes another plugins, for example AdMobPro plugin. I think this issue should be re-opened.

AUK4GIT commented 6 years ago

I have been trying to integrate the plugin. I fell some code changes are to be done in extended-device-information.js file.

  1. Replace channel.onCordovaInfoReady.fire(); with channel.onCordovaReady.fire();
  2. Enclose me.getInfo(function (info) {...} inside if(cordova.platformId === 'android') {...} this helps fix iOS plugin failure issue. ``` if(cordova.platformId === 'android') { me.getInfo(function (info) { var buildLabel = cordova.version; me.memory = info.memory || 'unknown'; me.cpumhz = info.cpumhz || 'unknown'; me.totalstorage = info.totalstorage || 'unknown';

        channel.onCordovaInfoReady.fire();
    }, function (e) {
        me.available = false;
        utils.alert("[ERROR] Error initializing Cordova: " + e);
    });

    }

danielehrhardt commented 6 years ago

@AUK4GIT Thank you for your help!! I applied your changed

AUK4GIT commented 6 years ago

Hi Daniel, Thank You. This plugin seems to be wrapped in ionic native plugin https://ionicframework.com/docs/native/extended-device-information/

But the variables are always returned null when accessed using the ionic native interface. "The Memory is: null"

Can you please look into this.

Thanks