Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: Attempting to call cordova.exec() before 'deviceready'. Ignoring

I'm trying to "PhoneGap" (1.7.0) a jQuery Mobile app (1.1.0) I have to create an Android app. However, I keep getting the following alert message.

ERROR: Attempting to call cordova.exec() before 'deviceready'. Ignoring.

It appears as if this I change pages (change for example index.1.htm to index.2.htm)

I'm not making any calls to Cordova functions in my app - it's pure JQM.

Any ideas what the problem is. Or, failing that, does anyone know why cordova.exec() might be called during an $.ajax request?

I'm running the app under Android 4.0.3, in a virtual device/simulator. Also try to run at Android 2.1, and 2.33 simulator device, getting this same error!

like image 473
Thiago Oliveira Avatar asked Jun 10 '12 01:06

Thiago Oliveira


1 Answers

Ensure that you are using the appropriate version of cordova-1.x.0.js (or phonegap.js)

Each platform uses a different version of the file.

This error coming up sometimes can mean you're using the iOS version in an Android application.

like image 60
Damian Keeghan Avatar answered Nov 12 '22 06:11

Damian Keeghan