Question

I am using Phone Gap to develop an app in Android. While deploying the app on emulator, I am getting this error logs

01-25 12:41:13.773: D/PhoneGapLog(491): Failed to run constructor: ReferenceError: Can't find variable: PluginManager
01-25 12:41:13.773: D/PhoneGapLog(491): file:///android_asset/www/phonegap-1.3.0.js: Line 210 : Failed to run constructor: ReferenceError: Can't find variable: PluginManager
01-25 12:41:13.773: I/Web Console(491): Failed to run constructor: ReferenceError: Can't find variable: PluginManager at file:///android_asset/www/phonegap-1.3.0.js:210

Even though my application works, then also the errors comes.

My .js file is

function GpsDetactionPlugin() {
};

GpsDetactionPlugin.prototype.checkGPS = function(suc,fail) {

 return PhoneGap.exec(suc, fail, "GpsDetactionPlugin", "gpsDetect", [null]);
};

PhoneGap.addConstructor(function() {
    PhoneGap.addPlugin("gpsDetaction", new GpsDetactionPlugin());
});

Why am i getting this unnecessary error log.How to stop it?

Was it helpful?

Solution

The JS code looks fine to me and I suspect the issue is somewhere else. I have a sample phonegap plugin at the following location which you can check to see that you have put all the configurations correct. Make sure you have put the plugin info in res/xml/plugin.xml

https://github.com/dhavaln/phonegap-examples/tree/master/phonegap-plugin-test

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top