“无法运行构造函数:ReferenceError:找不到变量:PluginManager”在安卓中

发布于 2024-12-29 05:39:15 字数 960 浏览 1 评论 0原文

我正在使用 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());
});

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

裸钻 2025-01-05 05:39:15

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

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文