Any call to a PhoneGap navigator.notification method is failing with the message "Result of expression navigator.notification [undefined] is not an object"
I've gone through the full installation and project generation process outlined here: http://p开发者_运维问答honegap.pbworks.com/Getting-started-with-Android-PhoneGap-in-Eclipse
...and the application works fine when run from Eclipse, except until trying to access the navigator object. Here is the JavaScript code that is throwing the error:
var beep = function() {
try {
if (navigator != null) {
navigator.notification.beep(2);
}
} catch (e) {
alert("Beep failed: " + e.message);
}
}
I think the cordova*.js
(src="cordova-2.1.0.js") is not same as in the www folder of your project. I had this same problem & changing the reference in Index.html page solved my problem.
See this link : phonegap-sample-application-for-android-does-not-work
精彩评论