如何在android中加载网站url时调试webview中的问题

时间:2017-03-09 11:43:40

标签: android webview web

我的问题是在我的Android应用程序中我正在加载我的客户端网站 android.webkit.Webview 组件我的所有应用程序工作正常我的应用程序没有问题,但在一个部分客户端想要加载单个网站页面。

但是我不知道我使用webview方法加载网站网址

 mywebview.loadUrl(url);

我的应用程序正在崩溃下面是您可以结帐的日志:

03-09 16:26:59.927 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(37)] "Typekit: the domain "autopearl.myshopify.com" isn't in the list of published domains for kit "jxm1pjf".", source: https://use.typekit.net/jxm1pjf.js (37)
03-09 16:27:00.468 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'block-all-mixed-content'.
                                                              ", source: about:blank (0)
03-09 16:27:00.468 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'upgrade-insecure-requests'.
                                                              ", source: about:blank (0)
03-09 16:27:00.470 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'block-all-mixed-content'.
                                                              ", source: about:blank (0)
03-09 16:27:00.472 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'upgrade-insecure-requests'.
                                                              ", source: about:blank (0)
03-09 16:27:00.620 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(65)] "Uncaught TypeError: Cannot read property 'getItem' of null", source: https://cdn.shopify.com/s/javascripts/shopify_stats.js?v=6 (65)
03-09 16:27:00.921 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'block-all-mixed-content'.
                                                              ", source: about:blank (0)
03-09 16:27:00.921 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'upgrade-insecure-requests'.
                                                              ", source: about:blank (0)
03-09 16:27:02.654 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(9)] "Facebook Pixel Warning: Multiple different pixels were detected on this page", source: https://connect.facebook.net/en_US/fbevents.js (9)
03-09 16:27:03.188 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'block-all-mixed-content'.
                                                              ", source: about:blank (0)
03-09 16:27:03.188 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'upgrade-insecure-requests'.
                                                              ", source: about:blank (0)
03-09 16:27:03.190 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'block-all-mixed-content'.
                                                              ", source: about:blank (0)
03-09 16:27:03.190 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'upgrade-insecure-requests'.
                                                              ", source: about:blank (0)
03-09 16:27:04.153 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'block-all-mixed-content'.
                                                              ", source: about:blank (0)
03-09 16:27:04.153 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'upgrade-insecure-requests'.
                                                              ", source: about:blank (0)
03-09 16:27:04.153 25581-25581/com.niks.webviewapp I/chromium: [INFO:CONSOLE(0)] "Unrecognized Content-Security-Policy directive 'block-all-mixed-content'.
                                                              ", source: about:blank (0)

您可以尝试在android webview中加载网站

网址: https://autopearl.myshopify.com/account/login 注意:我已经尝试在Chrome浏览器中加载它没有崩溃。所以请尝试在android中加载 android.webkit.Webview

我想告诉网站中的确切问题,因为我的应用程序正在崩溃。 请帮帮忙?

1 个答案:

答案 0 :(得分:0)

您需要启用DomStorageEnabled AS True

Android

webview.settings.domStorageEnabled = true