2

我正在使用 Phone Gap 在 Android 中开发应用程序。在模拟器上部署应用程序时,我收到此错误日志

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

即使我的应用程序有效,但也会出现错误。

我的.js文件是

function GpsDetactionPlugin() {
};

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

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

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

为什么我会收到这个不必要的错误日志。如何停止它?

4

1 回答 1

1

JS 代码对我来说看起来不错,我怀疑问题出在其他地方。我在以下位置有一个示例 phonegap 插件,您可以检查它以确保所有配置都正确。确保您已将插件信息放入 res/xml/plugin.xml

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

于 2012-01-25T09:40:17.267 回答