I'm seeing a very strange issue.
In my code, I have the following condition:
if (Build.VERSION.SDK_INT >= 19)
myWebView.evaluateJavascript("..."), null);
else
myWebView.loadUrl("...");
According to the docs, evaluateJavascript
should be available from 4.4 (API 19) and up.
Starting from about a couple of weeks ago, I've been getting crashes from multiple users running Kitkat:
java.lang.IllegalStateException: This API not supported on Android 4.3 and earlier
at android.webkit.WebViewClassic.evaluateJavaScript(WebViewClassic.java:2674)
at android.webkit.WebView.evaluateJavascript(WebView.java:905)
All the users seeing this crash are either running Android 4.4.4, or 4.4.2, both of which should have this method.
The devices range from: Ascend G510, Ascend Y300, p715, PAD1042 and a few other obscure models.
I am quite baffled. I considered simply upping the requirement here to API 21 (lollipop), but that just doesn't seem right. My code should work, unless I'm missing something?
Anyone know what's going on here?