我好几天都有这种错误!我不知道问题在哪里,我不认为错误是在app.js,因为它是由phonegap生成的。 如果问题在我的问题中不是很清楚,我可以将我的邮政编码发送给某人 TKS
02-24 16:03:59.441: E/Trace(2885): error opening trace file: No such file or directory (2)
02-24 16:03:59.781: I/CordovaLog(2885): Changing log level to DEBUG(3)
02-24 16:03:59.841: D/Whitelist(2885): Unlimited access to network resources
02-24 16:03:59.841: D/CordovaActivity(2885): CordovaActivity.onCreate()
02-24 16:04:00.071: I/dalvikvm(2885): Could not find method org.apache.cordova.CordovaWebView.setWebContentsDebuggingEnabled, referenced from method org.apache.cordova.CordovaWebView.setup
02-24 16:04:00.071: W/dalvikvm(2885): VFY: unable to resolve static method 2029: Lorg/apache/cordova/CordovaWebView;.setWebContentsDebuggingEnabled (Z)V
02-24 16:04:00.071: D/dalvikvm(2885): VFY: replacing opcode 0x71 at 0x00ba
02-24 16:04:00.241: D/dalvikvm(2885): GC_FOR_ALLOC freed 65K, 7% free 2489K/2676K, paused 37ms, total 40ms
02-24 16:04:00.251: I/dalvikvm-heap(2885): Grow heap (frag case) to 3.152MB for 635812-byte allocation
02-24 16:04:00.311: D/dalvikvm(2885): GC_FOR_ALLOC freed 2K, 6% free 3108K/3300K, paused 62ms, total 62ms
02-24 16:04:00.451: D/dalvikvm(2885): GC_CONCURRENT freed 1K, 6% free 3126K/3300K, paused 81ms+4ms, total 136ms
02-24 16:04:00.542: D/CordovaWebView(2885): CordovaWebView is running on device made by: unknown
02-24 16:04:00.551: D/JsMessageQueue(2885): Set native->JS mode to 2
02-24 16:04:00.581: D/CordovaActivity(2885): CordovaActivity.init()
02-24 16:04:00.601: D/CordovaWebView(2885): >>> loadUrl(file:///android_asset/www/index.html)
02-24 16:04:00.631: D/PluginManager(2885): init()
02-24 16:04:00.661: D/CordovaWebView(2885): >>> loadUrlNow()
02-24 16:04:00.691: I/CordovaLog(2885): Found start page location: index.html
02-24 16:04:00.691: I/CordovaLog(2885): Changing log level to DEBUG(3)
02-24 16:04:00.691: D/Whitelist(2885): Unlimited access to network resources
02-24 16:04:00.691: D/CordovaActivity(2885): Resuming the App
02-24 16:04:00.691: D/CordovaActivity(2885): CB-3064: The errorUrl is null
02-24 16:04:00.771: D/SoftKeyboardDetect(2885): Ignore this event
02-24 16:04:00.871: D/gralloc_goldfish(2885): Emulator without GPU emulation detected.
02-24 16:04:01.071: D/SoftKeyboardDetect(2885): Ignore this event
02-24 16:04:01.331: D/CordovaActivity(2885): onMessage(onPageStarted,file:///android_asset/www/index.html)
02-24 16:04:01.600: D/SoftKeyboardDetect(2885): Ignore this event
02-24 16:04:02.221: D/dalvikvm(2885): GC_CONCURRENT freed 93K, 7% free 3488K/3728K, paused 11ms+5ms, total 78ms
02-24 16:04:02.221: D/dalvikvm(2885): WAIT_FOR_CONCURRENT_GC blocked 67ms
02-24 16:04:03.301: D/CordovaLog(2885): file:///android_asset/www/phonegap.js: Line 1544 : Could not find cordova.js script tag. Plugin loading may fail.
02-24 16:04:03.311: I/Web Console(2885): Could not find cordova.js script tag. Plugin loading may fail. at file:///android_asset/www/phonegap.js:1544
02-24 16:04:12.800: D/CordovaLog(2885): file:///android_asset/www/phonegap.js: Line 1128 : deviceready has not fired after 5 seconds.
02-24 16:04:12.800: I/Web Console(2885): deviceready has not fired after 5 seconds. at file:///android_asset/www/phonegap.js:1128
02-24 16:04:12.830: D/CordovaLog(2885): file:///android_asset/www/phonegap.js: Line 1121 : Channel not fired: onPluginsReady
02-24 16:04:12.830: I/Web Console(2885): Channel not fired: onPluginsReady at file:///android_asset/www/phonegap.js:1121
02-24 16:04:12.840: D/CordovaLog(2885): file:///android_asset/www/phonegap.js: Line 1121 : Channel not fired: onCordovaReady
02-24 16:04:12.840: I/Web Console(2885): Channel not fired: onCordovaReady at file:///android_asset/www/phonegap.js:1121
02-24 16:04:12.851: D/CordovaLog(2885): file:///android_asset/www/phonegap.js: Line 1121 : Channel not fired: onDOMContentLoaded
02-24 16:04:12.851: I/Web Console(2885): Channel not fired: onDOMContentLoaded at file:///android_asset/www/phonegap.js:1121
02-24 16:04:13.240: D/CordovaLog(2885): file:///android_asset/www/js/plugins/console-via-logger.js: Line 24 : Uncaught ReferenceError: require is not defined
02-24 16:04:13.240: E/Web Console(2885): Uncaught ReferenceError: require is not defined at file:///android_asset/www/js/plugins/console-via-logger.js:24
02-24 16:04:13.290: D/CordovaLog(2885): file:///android_asset/www/js/plugins/logger.js: Line 43 : Uncaught ReferenceError: exports is not defined
02-24 16:04:13.290: E/Web Console(2885): Uncaught ReferenceError: exports is not defined at file:///android_asset/www/js/plugins/logger.js:43
02-24 16:04:13.440: D/CordovaWebViewClient(2885): onPageFinished(file:///android_asset/www/index.html)
02-24 16:04:13.440: D/CordovaActivity(2885): onMessage(onPageFinished,file:///android_asset/www/index.html)
02-24 16:04:13.510: D/CordovaActivity(2885): onMessage(spinner,stop)
02-24 16:04:13.532: W/PluginManager(2885): THREAD WARNING: exec() call to App.show blocked the main thread for 25ms. Plugin should use CordovaInterface.getThreadPool().
02-24 16:04:13.651: D/TilesManager(2885): Starting TG #0, 0x2a321ca8
02-24 16:04:14.280: D/CordovaLog(2885): file:///android_asset/www/app.js: Line 1 : Uncaught TypeError: Cannot read property 'name' of undefined
02-24 16:04:14.280: E/Web Console(2885): Uncaught TypeError: Cannot read property 'name' of undefined at file:///android_asset/www/app.js:1
02-24 16:04:14.290: I/Choreographer(2885): Skipped 117 frames! The application may be doing too much work on its main thread.
02-24 16:04:15.520: D/CordovaActivity(2885): onMessage(spinner,stop)
02-24 16:05:54.430: I/Choreographer(2885): Skipped 38 frames! The application may be doing too much work on its main thread.
02-24 16:05:55.660: I/Choreographer(2885): Skipped 31 frames! The application may be doing too much work on its main thread.
02-24 16:06:00.121: I/Choreographer(2885): Skipped 33 frames! The application may be doing too much work on its main thread.
02-24 16:07:34.432: I/Choreographer(2885): Skipped 30 frames! The application may be doing too much work on its main thread.
答案 0 :(得分:1)
2件可能的事情:
您需要包含cordova.js文件
<script src="cordova.js"></script>
ondeviceready永远不会从浏览器中触发。你可以用这个:
$(function() {
document.addEventListener('deviceready', onDeviceReady, false);
//for testing in Chrome browser uncomment
//onDeviceReady();
});
function onDeviceReady()
{
//do your stuff
}
希望有所帮助