preloader
image

How to fix suddenly broken applications after LineageOS update

Did a few apps stop working since you last time updated your LineageOS? Suddenly you can’t log in or can’t connect? Here is the solution!

The problem

Let us take an example, there is a Taxi service in Hungary that I use, and I’ve noticed, that basically nothing works in the application anymore. I have tried to reinstall the app, but after that, I wasn’t even able to log in to the app anymore.

Digging through the android logs, I’ve found this:

SystemWebChromeClient: file:///android\_asset/www/index.html#/login: Line 0 : Access to XMLHttpRequest at 'https://onehungariantaxiservice.hu/…/login' from origin 'file://' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'http://localhost' that is not equal to the supplied origin.
chromium: \[INFO:CONSOLE(0)\] "Access to XMLHttpRequest at 'https://onehungariantaxiservice.hu/…/login' from origin 'file://' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'http://localhost' that is not equal to the supplied origin.", source: file:///android\_asset/www/index.html#/login (0)

I had not much time on my hands, so I’ve contacted their support, and called a taxi instead of using the app:) They responded quite quickly, saying that indeed, they have updated their IIS servers, and they checked their configurations.

Sadly the app still did not work. I wrote to them again, this time they said that let me try with a different version of android. :/ So now I went on to debug this problem, spoiler: it was really not their fault.

Android WebView

There is a thing in Android, that’s called a WebView, this is basically a browser engine (generally based on Chrome or Chromium), that many apps use to show inline HTML content, and many apps are using it, for different reasons. (e.g. it’s easier to design the UI than in the native Android ecosystem, etc.)

As it turns out, LineageOS accidentally included a buggy version of this WebView, namely: 76.0.3809.111.

You can check your WebView version by going to Settings > Apps > Android System WebView.

The good news is that it is already fixed. But I’ve checked the Oneplus 5T images between 2019-09-16 and 2019-09-25 and they all come with the buggy version, but there is another way to update it…

The solution

The steps to fix this are the following:

  1. Install a newer version of Android System WebView
    1. If you are living without the Google apps, you might want to check this out.
  2. Enable the developer options
    1. Go to Settings > About phone
    2. Tap several times on “Build number”
  3. Go to Settings > System > Advanced > Developer options
  4. Scroll to “WebView implementation” and change it.

And that’s it!

Let me know if it helped you!:)

Postscript

Let us all give thanks (and optionally donations too) to the great LineageOS community, who is providing us this awesome OS. Thank you, guys!