[英]How to solve webview error
I have some error in logcat that I don't know how to fix it.I need some help to find solution. 我在logcat中有一些错误,我不知道如何解决它。我需要一些帮助才能找到解决方案。
04-04 15:49:37.143 2088-2107/com.exercise.AndroidHTML W/chromium﹕ [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
04-04 15:49:37.153 2088-2088/com.exercise.AndroidHTML D/﹕ HostConnection::get() New Host Connection established 0xb8eab450, tid 2088
04-04 15:49:37.293 2088-2088/com.exercise.AndroidHTML D/dalvikvm﹕ GC_FOR_ALLOC freed 76K, 5% free 3423K/3576K, paused 5ms, total 7ms
04-04 15:49:37.323 2088-2088/com.exercise.AndroidHTML D/dalvikvm﹕ GC_FOR_ALLOC freed 2K, 5% free 3643K/3800K, paused 4ms, total 7ms
04-04 15:49:37.323 2088-2088/com.exercise.AndroidHTML I/dalvikvm-heap﹕ Grow heap (frag case) to 6.047MB for 2536932-byte allocation
04-04 15:49:37.343 2088-2102/com.exercise.AndroidHTML D/dalvikvm﹕ GC_FOR_ALLOC freed 1K, 3% free 6119K/6280K, paused 2ms, total 2ms
04-04 15:49:37.733 2088-2088/com.exercise.AndroidHTML W/EGL_emulation﹕ eglSurfaceAttrib not implemented
04-04 15:49:37.733 2088-2088/com.exercise.AndroidHTML D/OpenGLRenderer﹕ Enabling debug mode 0
04-04 15:49:37.763 2088-2088/com.exercise.AndroidHTML W/AwContents﹕ nativeOnDraw failed; clearing to background color.
04-04 15:49:38.113 2088-2088/com.exercise.AndroidHTML W/AwContents﹕ nativeOnDraw failed; clearing to background color.
04-04 15:49:38.763 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000b44
04-04 15:49:38.773 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000bd0
04-04 15:49:38.863 2088-2088/com.exercise.AndroidHTML I/chromium﹕ [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
04-04 15:49:39.063 2088-2088/com.exercise.AndroidHTML I/chromium﹕ [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
04-04 15:49:39.103 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ **** ERROR unknown type 0x0 (glSizeof,72)
04-04 15:49:39.153 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000b44
04-04 15:49:39.153 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000bd0
04-04 15:49:39.173 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ **** ERROR unknown type 0x0 (glSizeof,72)
04-04 15:49:39.183 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000b44
04-04 15:49:39.193 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000bd0
04-04 15:49:39.233 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ **** ERROR unknown type 0x0 (glSizeof,72)
04-04 15:49:40.913 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000b44
04-04 15:49:40.923 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000bd0
04-04 15:49:40.943 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ **** ERROR unknown type 0x0 (glSizeof,72)
04-04 15:49:41.013 2088-2088/com.exercise.AndroidHTML I/chromium﹕ [INFO:CONSOLE(132)] "Uncaught TypeError: Object [object Object] has no method 'ReadDB'", source: file:///android_asset/index.html (132)
04-04 15:49:41.923 2088-2088/com.exercise.AndroidHTML I/Choreographer﹕ Skipped 48 frames! The application may be doing too much work on its main thread.
04-04 15:49:41.923 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000b44
04-04 15:49:41.933 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000bd0
04-04 15:49:42.063 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ **** ERROR unknown type 0x0 (glSizeof,72)
04-04 15:49:42.133 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000b44
04-04 15:49:42.143 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000bd0
04-04 15:49:42.153 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ **** ERROR unknown type 0x0 (glSizeof,72)
04-04 15:49:42.273 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000b44
04-04 15:49:42.283 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ glUtilsParamSize: unknow param 0x00000bd0
04-04 15:49:43.103 2088-2088/com.exercise.AndroidHTML E/eglCodecCommon﹕ **** ERROR unknown type 0x0 (glSizeof,72)
04-04 15:49:43.103 2088-2088/com.exercise.AndroidHTML I/Choreographer﹕ Skipped 49 frames! The application may be doing too much work on its main thread.
The error occurs only with the Android emulator, and is caused by having checked the "Use GPU Host" in the Android Virtual Device Manager. 该错误仅在Android模拟器中发生,并且是由检查Android虚拟设备管理器中的“使用GPU主机”引起的。 If you disable this option, the error will disappear, but the emulator will have a much worse performance. 如果禁用此选项,则错误将消失,但仿真器的性能会更差。
The other thing you can do is add this to the logcat filter to remove these messages: 您可以做的另一件事是将其添加到logcat过滤器以删除这些消息:
Log Tag (regex): ^ (?! (eglCodecCommon))
日志标记(正则表达式): ^ (?! (eglCodecCommon))
I hope it helped you 我希望它对你有帮助
I also have problem before, I trying to load Chatango on webview, then my problem solved using this code, try this: 我之前也有问题,我试图在webview上加载Chatango,然后使用这段代码解决了我的问题,试试这个:
import android.webkit.WebSettings; //dont forget import WebSettings
then webView attribute: 然后webView属性:
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
WebSettings websettings = webView.getSettings();
websettings.setJavaScriptEnabled(true);
websettings.setDomStorageEnabled(true);
websettings.setUserAgentString("Mozilla/5.0 (Linux; Android 4.1.2; C1905 Build/15.1.C.2.8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36");
webView.loadUrl(yourUrltoLoad);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.