尝试使用Android上的PhoneGap的插件时window.plugins未定义 [英] window.plugins undefined when trying to use the phonegap plugins on android

查看:133
本文介绍了尝试使用Android上的PhoneGap的插件时window.plugins未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能在android系统加载的插件。我已经加入了插件的列表plugins.xml,在我的项目已经添加了Java code。不过还是当我打电话 window.plugins 我得到了一个未定义的对象。这究竟是为什么?顺便说一句,我尝试使用共享插件 - https://开头github上。 COM / PhoneGap的/ PhoneGap的-插件/树/主/ Android版/股

I can't load the plugins in android. I have added the plugin to the plugins.xml list, have added the java code in my project. But still when I call window.plugins I get undefined object. Why is this happening? BTW I'm trying to use the share plugin - https://github.com/phonegap/phonegap-plugins/tree/master/Android/Share

只是要清楚,我已经加入了phonegap.js文件包含JS插件code中的share.js文件。此外,我已经使用了EmailComposer插件具有相同的code iPhone和它适用于iPhone,即iPhone上的window.plugins反对它不是不确定的。

Just to be clear, I have added the phonegap.js file and the share.js file containing the JS plugin code. Also I have used the EmailComposer plugin for iphone with same code and it works on iphone, i.e. on iphone the window.plugins object it isn't undefined.

推荐答案

我固定完全相同的问题后,注意到...我忘了在我的HTML引用的PhoneGap-1.1.0.js。我也不得不取消注释PhoneGap.addPlugin('份额',新股份());在share.js。

I fixed the exact same issue after noticing... i forgot to reference phonegap-1.1.0.js in my html. I also had to uncomment PhoneGap.addPlugin('share', new Share()); in share.js.

这篇关于尝试使用Android上的PhoneGap的插件时window.plugins未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆