Here's a WebView which loads a page with triggers a fetch() on a button click. The html is fine and the page is working in the browser. However the WebView does nothing on click.
override fun onCreate(savedInstanceState: Bundle?) {
var mWebView = findViewById(R.id.activity_main_webview) as WebView
var webSettings = mWebView.getSettings()
webSettings.setDomStorageEnabled(true)
webSettings.setJavaScriptEnabled(true)
webSettings.setLoadWithOverviewMode(true)
mWebView.webViewClient = WebViewClient()
mWebView.loadUrl("https://example.com")
}
The error in the debugging console in Android Studio is:
E/chromium: [ERROR:ssl_client_socket_impl.cc(959)] handshake failed; returned -1, SSL error code 1, net_error -200 I/chromium: [INFO:CONSOLE(0)] "Uncaught (in promise) TypeError: Failed to fetch", source: https://example.com/ (0)
What is the cause?