英文:
Flutter webview_flutter package handshake failed
问题
尝试使用webview_flutter包加载HTML文件时,会在加载时花费时间,并在打印此错误后加载WebView:
E/chromium(27944): [ERROR:ssl_client_socket_impl.cc(980)] handshake failed; returned -1, SSL error code 1, net_error -101
什么可能会触发这样的错误?
Flutter和WebView的版本:
Flutter(通道稳定,3.7.11)
webview_flutter:^4.0.2
英文:
When trying to load html file using webview_flutter package it takes time until loading while printing this error then it loads the webview
E/chromium(27944): [ERROR:ssl_client_socket_impl.cc(980)] handshake failed; returned -1, SSL error code 1, net_error -101
What could trigger such an error?
Flutter and Webview versions:
Flutter (Channel stable, 3.7.11)
webview_flutter: ^4.0.2
答案1
得分: 0
通过调试类似以下方式的 webview 错误来找到错误的来源:(仅适用于 Android)
onWebResourceError: (WebResourceError error) {
log("RESOURCE ERROR DESCRIPTION ${error.description}");
log("RESOURCE ERROR CODE ${error.errorCode}");
log("RESOURCE ERROR Error Type ${error.errorType}");
log("RESOURCE ERROR Failing URL ${error.url}");
},
我可以发现错误的源头是网站本身的一些 UI 资源,比如 Popper
导致了这个错误。
英文:
By debugging the webview errors like this: (Only works on Android)
onWebResourceError: (WebResourceError error) {
log("RESOURCE ERROR DESCRIPTION ${error.description}");
log("RESOURCE ERROR CODE ${error.errorCode}");
log("RESOURCE ERROR Error Type ${error.errorType}");
log("RESOURCE ERROR Failing URL ${error.url}");
},
I could find that the source of the errors is some UI resources in the website itself like Popper
causes this error
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论