0
我試圖製作一個webview,它可以正確執行html和javascript頁面。Webview JavaScript調用堆棧錯誤
但是,當我嘗試加載一個JavaScript文件的頁面時,它給了我一個超過最大調用堆棧大小的錯誤。
當我在其他所有瀏覽器中加載此頁面時,它都能正常工作。除了在JavaScript文件中加入東西外,我還需要做些什麼?
這裏是程序的logcat的:
04-11 12:44:43.390: D/OpenGLRenderer(1120): Flushing caches (mode 0)
04-11 12:45:00.499: I/dalvikvm(1180): threadid=3: reacting to signal 3
04-11 12:45:00.629: I/dalvikvm(1180): Wrote stack traces to '/data/anr/traces.txt'
04-11 12:45:00.929: I/dalvikvm(1180): threadid=3: reacting to signal 3
04-11 12:45:00.999: D/dalvikvm(1180): GC_FOR_ALLOC freed 38K, 4% free 6546K/6787K, paused 102ms
04-11 12:45:01.009: I/dalvikvm-heap(1180): Grow heap (frag case) to 7.042MB for 612016-byte allocation
04-11 12:45:01.020: I/dalvikvm(1180): Wrote stack traces to '/data/anr/traces.txt'
04-11 12:45:01.170: D/dalvikvm(1180): GC_CONCURRENT freed 1K, 4% free 7143K/7431K, paused 26ms+7ms
04-11 12:45:01.440: I/dalvikvm(1180): threadid=3: reacting to signal 3
04-11 12:45:01.489: I/dalvikvm(1180): Wrote stack traces to '/data/anr/traces.txt'
04-11 12:45:01.811: D/libEGL(1180): loaded /system/lib/egl/libGLES_android.so
04-11 12:45:01.830: D/libEGL(1180): loaded /system/lib/egl/libEGL_emulation.so
04-11 12:45:01.850: D/(1180): HostConnection::get() New Host Connection established 0x164788, tid 1180
04-11 12:45:01.910: D/libEGL(1180): loaded /system/lib/egl/libGLESv1_CM_emulation.so
04-11 12:45:01.910: D/libEGL(1180): loaded /system/lib/egl/libGLESv2_emulation.so
04-11 12:45:01.959: I/dalvikvm(1180): threadid=3: reacting to signal 3
04-11 12:45:02.019: I/dalvikvm(1180): Wrote stack traces to '/data/anr/traces.txt'
04-11 12:45:02.080: W/EGL_emulation(1180): eglSurfaceAttrib not implemented
04-11 12:45:02.099: D/OpenGLRenderer(1180): Enabling debug mode 0
04-11 12:45:02.451: I/dalvikvm(1180): threadid=3: reacting to signal 3
04-11 12:45:02.490: I/dalvikvm(1180): Wrote stack traces to '/data/anr/traces.txt'
04-11 12:45:02.950: I/dalvikvm(1180): threadid=3: reacting to signal 3
04-11 12:45:02.990: I/dalvikvm(1180): Wrote stack traces to '/data/anr/traces.txt'
04-11 12:45:38.392: I/dalvikvm(1180): threadid=3: reacting to signal 3
04-11 12:45:38.521: I/dalvikvm(1180): Wrote stack traces to '/data/anr/traces.txt'
04-11 12:45:38.569: W/EGL_emulation(1180): eglSurfaceAttrib not implemented
04-11 12:45:38.839: W/webcore(1180): java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
04-11 12:45:38.839: W/webcore(1180): at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:1683)
04-11 12:45:38.839: W/webcore(1180): at android.webkit.WebViewCore$EventHub.access$7900(WebViewCore.java:926)
04-11 12:45:38.839: W/webcore(1180): at android.webkit.WebViewCore.removeMessages(WebViewCore.java:1795)
04-11 12:45:38.839: W/webcore(1180): at android.webkit.WebView.sendOurVisibleRect(WebView.java:2917)
04-11 12:45:38.839: W/webcore(1180): at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:593)
04-11 12:45:38.839: W/webcore(1180): at android.webkit.ZoomManager.access$1700(ZoomManager.java:49)
04-11 12:45:38.839: W/webcore(1180): at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:984)
04-11 12:45:38.839: W/webcore(1180): at android.os.Handler.handleCallback(Handler.java:605)
04-11 12:45:38.839: W/webcore(1180): at android.os.Handler.dispatchMessage(Handler.java:92)
04-11 12:45:38.839: W/webcore(1180): at android.os.Looper.loop(Looper.java:137)
04-11 12:45:38.839: W/webcore(1180): at android.app.ActivityThread.main(ActivityThread.java:4424)
04-11 12:45:38.839: W/webcore(1180): at java.lang.reflect.Method.invokeNative(Native Method)
04-11 12:45:38.839: W/webcore(1180): at java.lang.reflect.Method.invoke(Method.java:511)
04-11 12:45:38.839: W/webcore(1180): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-11 12:45:38.839: W/webcore(1180): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-11 12:45:38.839: W/webcore(1180): at dalvik.system.NativeStart.main(Native Method)
04-11 12:45:38.909: I/dalvikvm(1180): threadid=3: reacting to signal 3
04-11 12:45:39.040: I/dalvikvm(1180): Wrote stack traces to '/data/anr/traces.txt'
04-11 12:45:39.520: D/OpenGLRenderer(1180): Flushing caches (mode 0)
04-11 12:46:11.329: E/Web Console(1180): Uncaught RangeError: Maximum call stack size exceeded at http://192.168.2.5/PADS4/apps/viewer/PADSViewer.js:327
這並沒有幫助我。我不知道該怎麼辦這個錯誤。有沒有簡單的方法來修復它的應用程序? – user3523749