deviceready has not fired after 5 seconds

I have a big problems… when a use

document.addEventListener(“deviceready”, onDeviceReady, false);

function onDeviceReady() {
    $scope.prueba = 'ready';

}

I have this error

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

Any help?.

Thanks

Why don’t you use $ionicPlatform.ready() ?

dont work… too… i am using windows cordova and ionic.

Are you running this in a web browser? If so, you can’t use Cordova, it needs to be run on an actual device. This may be why you are seeing that error. My guess is a plugin you have installed is waiting for cordovaInfoReady

yes, i am using web browser… so if i want to use any plugins that use deviceready i have to test on phisycal device?

You’re close, but its actually, if you want to use any plugins that relies on Cordova, such as the Camera, Contacts, Push Notifications etc, you need to use an actual device.

The reason being Cordova isn’t present in your web browser. It gets added in when you build for a specific platform.

Cordova is basically a way for an app to run in a web browser on your phone (Safari - IOS/ Chrome-Android) and still have access to the device functionality.

This can make debugging somewhat annoying so some work arounds are, check if you have Cordova, if not, then use something else. Like if you can’t use the Camera but need to test uploading an image, test using an image saved in your project. If you want to test listing out contacts, make some dummy contacts, etc.

Make sense?