• 10
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Cordova not using the latest Android System Webview

I may have found an answer to the problem here, but was wondering if there is any more recent info.

I have a simple 'hello world' cordova app where I check the version of the webview via navigator.userAgent as well as with the cordova-plugin-webview-checker. (Android 5.1.1)

The userAgent is coming back showing a really old version of Chrome (39):

navigator Mozilla/5.0 (Linux; Android 5.1.1; rk3288 Build/LMY48Y) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Safari/537.36

However, the webview checker thinks I'm using the most recent version, > 72. I have the latest 'Android System Webview' installed on my device.

After doing some research, it appears the problem stems from the Android device being 'hardcoded' to access the webview from com.android.webview instead of com.google.android.webview, which is where it needs to go to find the latest installed version.

If this is indeed the problem, the question is what is the most painless way to resolve this? I couldn't find many example of the problem and Cordova doesn't seem to have an official workaround for this.

Thanks

      • 1
    • Until Android 5.0 which allowed for upgradable WebView, the recommendation was to use the NOW DEPRECATED Crosswalk Project as the WebView. While the site no longer exists, its ghost exists on archive.org I don't know if enough of the site survives there to be useful. This might be a solution if you are unable to change hardware and need more recent webkit features.
      • 1
    • It turned out I was not able to root the device, so Crosswalk was my only option. Even though it's deprecated, and the webview it's using is not the absolute latest, it works, and basically saved the project!
    • Great that it worked out for you. Found about about Mozllia's GeckoView afterward and made answer for future viewers.

For using a recent WebView engine on Android and you can't use Android System WebView or Google Chrome:

Prior to Android 5.0 improvements to the Android WebView was limited to OS upgrades/updates. So the recommendation was to use the NOW DEPRECATED Crosswalk Project as the WebView. While the site no longer exists, its ghost exists on archive.org I don't know if enough of the site survives there to be useful. This might be a solution if you are unable to change hardware and need more recent webkit features.

As the Crosswalk Project is no longer updated, or it doesn't have the features you need, I've learned that Mozilla has a GeckoView which wraps their Gecko render engine.

Note that according to Mozilla's documentation they have their own APIs so are NOT a drop-in replacement for Android's WebView, so some effort must be made to integrate into Cordova.

  • 1
Reply Report