2013-10-08 28 views
1

我們正在使用Phonegap 3.1.0-0.15.0,並且在嘗試訪問位置信息時應用程序發生堵塞。 iOS中工作正常但是在AndroidAndroid:Phonegap 3.1.x無法加載地理位置插件

的應用程序塞滿

我們使用:

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 

我們做錯了什麼?

謝謝你提前

/愛德華。

+0

您是否在您的index.html中包含了cordova腳本? aharris88

+0

是的cordova.js包含在內 – ECostello

回答

0

只是爲了回答我自己的問題。

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

這解決了我的問題:我使用以下命令手動刪除所有的插件,然後將它們添加(包括有問題的地理定位插件)。

愛德華。

+0

嘿,愛德華,只是試了一下,但沒有運氣,甚至沒有運氣,甚至在狀態欄上顯示gps圖標讓一個孤獨的獲得一個GPS點。它只是超時。 任何其他調整或解決方法? 謝謝! – nairobi