Android:Phonegap 3.1.x无法加载地理位置插件

时间:2013-10-08 16:47:26

标签: android cordova phonegap-plugins

我们正在使用Phonegap 3.1.0-0.15.0,并且在尝试访问位置信息时应用程序被阻塞。 适用于iOS,但Android上的App chock

我们正在使用:

navigator.geolocation.getCurrentPosition(app.location.onSuccess, app.location.onError);

我们也尝试过:

var geo = cordova.require('cordova/plugin/geolocation');
geo.getCurrentPosition(app.location.onSuccess, app.location.onError);

logcat提到了以下内容:

Could not find cordova.js script tag. Plugin loading may fail. at file:///android_asset/www/phonegap.js:1511
Uncaught module cordova/plugin/geolocation not found at file:///android_asset/www/phonegap.js:56

插件使用以下内容添加:

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git

我们做错了吗?

提前谢谢

/ Edwardo。

1 个答案:

答案 0 :(得分:0)

回答我自己的问题。我手动删除了所有插件,然后使用以下命令添加它们(包括有问题的地理定位插件):

phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git

这解决了我的问题。

爱德华。