Error on device ready? Anyone can help?


#1

deviceready has not fired after 5 seconds.
console-via-logger.js:173Channel not fired: onCordovaInfoReady
console-via-logger.js:173Channel not fired: onCordovaConnectionReady

Any idea what can be wrong?

code is

$scope.insertDBSYNC = function(){
	$ionicPlatform.ready(function() {
	var db = app.GetDataBase();
	var query = "INSERT INTO DeviceInfoTable(Setting,Value) VALUES(?,?)";
	$cordovaSQLite.execute(db,query,['DBCreated','YES']).then(function(r){
				app.Logger("DeviceInfoTable id ->" + r.insertId);
			},function(e){
				app.Logger(e);
			})
		$scope.progressStatus = $scope.progressStatus +1;
		$state.go('/');
	})};

Deviceready has not fired after 5 seconds
#2

Anyone can help me or have any solution to this im using nigthly build:)


#3
  $ionicPlatform.ready(function() {
    $scope.insertDBSYNC = function() {
      var db = app.GetDataBase();
      var query = "INSERT INTO DeviceInfoTable(Setting,Value) VALUES(?,?)";
      $cordovaSQLite.execute(db, query, ['DBCreated', 'YES']).then(function(r) {
        app.Logger("DeviceInfoTable id ->" + r.insertId);
      }, function(e) {
        app.Logger(e);
      })
      $scope.progressStatus = $scope.progressStatus + 1;
      $state.go('/');
    };
  });

Try this


#4

i have added this

    $ionicPlatform.ready(function() {
    $scope.Sync();
});

at end of file because this function call chain of functions but still not ready after 5 secounds.


#5

hmm, lets try commenting out the db code.
Is device ready firing at all?
What device are you testing this on?


#6

iPad-Retina emulator and iPad2 but on ionic serve its working;)

code is looking now like this

    		app.Logger("im here");
        $ionicPlatform.ready(function() {
			//$scope.Sync();
			app.Logger("fired");
		});

console logs

[Log] im here (app.js, line 15)
[Log] deviceready has not fired after 5 seconds. (console-via-logger.js, line 173)
[Log] Channel not fired: onCordovaInfoReady (console-via-logger.js, line 173)
[Log] Channel not fired: onCordovaConnectionReady (console-via-logger.js, line 173)

#7

Hmm, weird I can’t replicate this locally.
Try replacing app.Logger with console.log


#8

This is console.log :wink:
app.Logger = function(log){ console.log(log); }
but after changing still no response ;/ its inside controller the ready function this is okay?


#9

I’m using latest cordova maybe this causing problem?


#10

Hmm, yeah that shouldn’t be an issue. Are you getting any errors or anything else?
Can you try this with a blank project? What cordova plugins do you have installed?


#11

How to check plugins?


#12
ionic plugin ls

#13

com.brodysoft.sqlitePlugin 1.0.3 "Brodysoft SQLitePlugin"
com.ionic.keyboard 1.0.3 "Keyboard"
org.apache.cordova.console 0.2.12 "Console"
org.apache.cordova.device 0.2.13 "Device"
org.apache.cordova.network-information 0.2.14 “Network Information”


#14

I removed “Network Information” plugin and I don’t see these messages anymore.

command: cordova plugins rm org.apache.cordova.network-information


#15

Android with crosswalk here.

I have the same problem only if I run the app with browser-sync ionic run android -l -c -s

I didn’t have the “Network Information” plugin so I removed the “Device” plugin and now the event fired as it should.
But something else happend. I use the globaliztion plugin and it is present under navigator.globalization but nothing happens (no error).

As soon as I install the app normal via ionic run android everything works fine, the device ready event is fired and the globalization plugin returns me the language string. So I’d say at least for me all the problems are connected to the fact that the app content is served by the ionic server (in order to use browser-sync).


#16

Same problem was here, once I removed network plugin, the device ready started to fire.
Use:
ionic plugin remove cordova-plugin-network-information