0
Cordova發生了一件奇怪的事情,即使是最簡單的代碼也不行。代碼工作得很好,但從昨天開始不是。我沒有更改manifest.xml或任何其他文件中的任何內容。它是我的設備嗎?Phonegap正常工作,但現在不是
<title>Device Properties Example</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for Cordova to load
//
function onload(){
document.addEventListener("deviceready", onDeviceReady, false);
}
// Cordova is ready
//
function onDeviceReady() {
alert('test')
var element = document.getElementById('deviceProperties');
console.log('test');
element.innerHTML = 'Device Name: ' + device.name + '<br />' +
'Device Cordova: ' + device.cordova + '<br />' +
'Device Platform: ' + device.platform + '<br />' +
'Device UUID: ' + device.uuid + '<br />' +
'Device Model: ' + device.model + '<br />' +
'Device Version: ' + device.version + '<br />';
}
</script>
現在我不能再運行科爾多瓦了。這是我得到logcat
:
05-15 11:46:33.478: I/CordovaLog(26092): Changing log level to DEBUG(3) 05-15 11:46:33.478: I/CordovaLog(26092): Found preference for useBrowserHistory=true 05-15 11:46:33.478: D/CordovaLog(26092): Found preference for useBrowserHistory=true 05-15 11:46:33.478: I/CordovaLog(26092): Found preference for exit-on-suspend=false 05-15 11:46:33.478: D/CordovaLog(26092): Found preference for exit-on-suspend=false 05-15 11:46:33.483: I/CordovaLog(26092): Found preference for loadingDialog=MORE, Loading... 05-15 11:46:33.483: D/CordovaLog(26092): Found preference for loadingDialog=MORE, Loading... 05-15 11:46:33.503: D/JsMessageQueue(26092): Set native->JS mode to 2 05-15 11:46:33.508: D/DroidGap(26092): DroidGap.init() 05-15 11:46:33.618: D/CordovaWebView(26092): >>> loadUrl(file:///android_asset/www/index.html) 05-15 11:46:33.618: D/PluginManager(26092): init() 05-15 11:46:33.623: D/CordovaWebView(26092): >>> loadUrlNow() 05-15 11:46:33.628: D/DroidGap(26092): Resuming the App 05-15 11:46:33.688: D/SoftKeyboardDetect(26092): Ignore this event 05-15 11:46:33.698: D/DroidGap(26092): onMessage(onPageStarted,file:///android_asset/www/index.html) 05-15 11:46:34.088: D/SoftKeyboardDetect(26092): Ignore this event 05-15 11:46:36.068: D/Cordova(26092): onPageFinished(file:///android_asset/www/index.html) 05-15 11:46:36.068: D/DroidGap(26092): onMessage(onNativeReady,null) 05-15 11:46:36.068: D/DroidGap(26092): onMessage(onPageFinished,file:///android_asset/www/index.html) 05-15 11:46:38.068: D/DroidGap(26092): onMessage(spinner,stop) 05-15 11:46:38.353: W/dalvikvm(26092): disableGcForExternalAlloc: false
有什麼不對?
:清除設備的緩存,然後再試一次 –
它現在可以工作,但getcurrentposition不會工作了...... – Frank