我在我的应用程序中使用WebView,而加载内容警告日志来自logcat,如下所示
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.webkit.SafeBrowsingResponse" on path: DexPathList[[zip file "/data/app/com.android.chrome-1/base.apk"],nativeLibraryDirectories=[/data/app/com.android.chrome-1/lib/arm, /data/app/com.android.chrome-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]] 在那之后应用程序一次又一次崩溃
04-25 09:46:49.219 26505-26505/com.abc W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
04-25 09:46:49.219 26505-26505/com.abc W/google-breakpad: Chrome build fingerprint:
04-25 09:46:49.219 26505-26505/com.abc W/google-breakpad: 5.0.7lab
04-25 09:46:49.219 26505-26505/com.abc W/google-breakpad: 58
04-25 09:46:49.219 26505-26505/com.abc W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
04-25 09:46:49.219 26505-26505/com.whence A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xca480db0 in tid 26505 (com.whence)
[ 04-25 09:46:49.219 469: 469 W/ ]
debuggerd: handling request: pid=26505 uid=10314 gid=10314 tid=26505发布于 2018-06-26 22:23:24
问题的解决方案是:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
view.getSettings().setSafeBrowsingEnabled(false);
}
WebSettings settings = view.getSettings();
settings.setJavaScriptEnabled(true);如果这对你不起作用,请告诉我。
发布于 2018-04-25 12:30:24
webView.getSettings().setJavaScriptEnabled(true);尝试添加这些行。有关更多信息,请访问https://developer.android.com/reference/android/webkit/WebSettings.html
发布于 2018-04-25 12:54:53
由于这是在API27中添加的,请尝试如下设置SDK级别:
min=27
target=27
compile=27https://stackoverflow.com/questions/50014031
复制相似问题