My Android app injects JS code into a WebView. It is targeted Android 3.1 but I am experiencing issue with Android 6 and 7 because of the WebView now being chromium inside so it is not the old WebView.
Nevertheless the issue is very strange so I do not think it is because of the quirksmode my app forces to Android 6 and 7.
My app uses all the useful calls to load the JS interface that creates a binding between the Java code and the JS code, and it works on previous versions. After those instructions (addJavascriptInterface() method) it performs a "fake" loading to ensure the JS interface is loaded:
webView.loadData("", "text/html", null);
and when the "page" is loaded, it performs the loading of the real url, that is a local file (file:///...); when this is loaded too a script is injected and executed.
What I experience is that I get the following error on the log cat continuously:
Cannot call determinedVisibility() - never saw a connection for the pid:
and I tried the various suggestions found on SO about this, but no success:
it's the "data:text/html" url that keeps being loaded again and again and I can stop it only loading an empty url but then the JS interface is lost.
What have I to do to keep the JS interface and block the infinite loading loop?