0

最近我升级了我的应用程序以使用 Cordova-2.2.0。在 Android 设备 2.3 及更高版本上完美运行。但是当我在 Android 2.2 上运行该应用程序时,它会在启动时引发警报

“异常构建cordova JS gloals:RangeError:超过关键“连接”的最大调用堆栈大小。

不知道这里发生了什么。有什么线索吗?

日志:

01-16 14:09:30.389: I/MAIN(981): MyActivity::onCreate
01-16 14:09:30.389: D/DroidGap(981): DroidGap.onCreate()
01-16 14:09:30.419: D/CordovaWebView(981): Origin to allow: http://127.0.0.1*
01-16 14:09:30.419: D/CordovaWebView(981): Origin to allow: .*
01-16 14:09:30.419: I/CordovaLog(981): Found log level DEBUG
01-16 14:09:30.419: I/CordovaLog(981): Changing log level to DEBUG(3)
01-16 14:09:30.419: I/CordovaLog(981): Found preference for useBrowserHistory=true
01-16 14:09:30.419: D/CordovaLog(981): Found preference for useBrowserHistory=true
01-16 14:09:30.429: I/CordovaLog(981): Found preference for exit-on-suspend=false
01-16 14:09:30.429: D/CordovaLog(981): Found preference for exit-on-suspend=false
01-16 14:09:30.439: D/JsMessageQueue(981): Set native->JS mode to 2
01-16 14:09:30.439: I/CordovaWebView(981): Disabled addJavascriptInterface() bridge since Android version is old.
01-16 14:09:30.439: D/DroidGap(981): DroidGap.init()
01-16 14:09:30.449: D/CordovaWebView(981): DroidGap.loadUrl(file:///android_asset/www/common/index.html, 10000)
01-16 14:09:30.449: D/DroidGap(981): onMessage(splashscreen,show)
01-16 14:09:30.449: D/CordovaWebView(981): >>> loadUrl(file:///android_asset/www/common/index.html)
01-16 14:09:30.449: D/PluginManager(981): init()
01-16 14:09:30.449: D/CordovaWebView(981): >>> loadUrlNow()
01-16 14:09:30.449: D/DroidGap(981): Resuming the App
01-16 14:09:30.499: D/SoftKeyboardDetect(981): Ignore this event
01-16 14:09:30.569: D/SoftKeyboardDetect(981): Ignore this event
01-16 14:09:30.579: D/DroidGap(981): onMessage(onPageStarted,file:///android_asset/www/common/index.html)
01-16 14:09:30.889: D/Cordova(981): onPageFinished(file:///android_asset/www/common/index.html#welcome)
01-16 14:09:30.889: D/DroidGap(981): onMessage(onNativeReady,null)
01-16 14:09:30.889: D/DroidGap(981): onMessage(onPageFinished,file:///android_asset/www/common/index.html#welcome)
01-16 14:09:30.899: D/Cordova(981): onPageFinished(file:///android_asset/www/common/index.html#welcome)
01-16 14:09:30.899: D/DroidGap(981): onMessage(onNativeReady,null)
01-16 14:09:30.899: D/DroidGap(981): onMessage(onPageFinished,file:///android_asset/www/common/index.html#welcome)
01-16 14:09:32.900: D/DroidGap(981): onMessage(spinner,stop)
01-16 14:09:32.959: D/DroidGap(981): onMessage(spinner,stop)
01-16 14:10:30.209: D/DroidGap(981): Paused the application!
01-16 14:10:30.209: D/CordovaWebView(981): Handle the pause
01-16 14:12:41.879: I/MAIN(981): Ac2Activity::onResume
01-16 14:12:41.879: D/DroidGap(981): Resuming the App
01-16 14:13:42.099: D/DroidGap(981): Paused the application!
01-16 14:13:42.099: D/CordovaWebView(981): Handle the pause
4

1 回答 1

0

尝试在 Html 页面的 Head 部分添加您的 cordova 脚本。

实际上对我来说,这个解决方案也很有效。

于 2013-01-21T05:11:35.880 回答