tradingview/lightweight-charts-android

Crash report

shahradelahi opened this issue · 9 comments

It's working with SDK Version 28 and higher, but it's not working below that.

W/zygote: Attempt to remove non-JNI local reference, dumping thread
I/chromium: [INFO:CONSOLE(3802)] "Uncaught SyntaxError: Failed to execute 'addColorStop' on 'CanvasGradient': The value provided ('#2962ff4c') could not be parsed as a color.", source: file:///android_asset/com/tradingview/lightweightcharts/scripts/app/main.js (3802)

It's just keeps crashing and sometimes showing a black screen.

Screenshot: https://imgur.com/a/u9b5qgx

Hi! What version of webview do you have on devices with SDK below 28?

Hi,
I tested out the demo app on 3 different SDK's (26, 27, 28), and here is the result.

Demo app: https://imgur.com/a/rF88QU6
Webview version: https://imgur.com/a/Rbckhsi

I tied to update the Webview, but it's not available!
Google Play: https://imgur.com/a/lfnktnE

Also tried it on my own phone (SDK 28) it was working fine same as emulator SDK 28.

Edit:
I tried using tradingview/lightweight-charts and loaded URL into the Webview and as expected it's working on Chrome but not Android Webview.

Anyway, still, users with SDK below 28 can't use it, Is there any way to fix the issue with updating the Webview version?

It's impossible to fix this in the library. WebView in SDK is a proxy class and its implementation is provided by vendor's firmware. In some devices you can change implementation of WebView in developer settings.

Most of devices use Chrome as WebView implementation by default. So you can give an advice to user to update Chrome (the latest version is 93). This is a problem of environment but not of the library

'#2962ff4c'

How this color was generated? Even though lightweight-charts seems support #rrggbbaa notation, but according to https://caniuse.com/css-rrggbbaa this is not supported by Chrome < 62.

We can fix the serialization of colors in the next update. I will add this issue in the milestone

Dear @makedonsky94, your advice was useful.

I updated Google Chrome to 93 (it was 61) and the problem has been solved.

But I have another question, what do I do with users who don't have Google Chrome by default Or the users who don't even have Chrome.

@timocov I didn't find this code on my project and that's not from me because I just copied the sample codes!

But I have another question, what do I do with users who don't have Google Chrome by default Or the users who don't even have Chrome.

Most of the phones have preinstalled Android System WebView. If the user has no Chrome installed on the device then Android will use Android System WebView instead.
Some of devices have specific browsers like Huawei WebView. Most of them are using Chromium so no panic.

And here are some users who rooted their devices and deleted every browser. After those manipulation the app will crash as soon as WebView will appear. We have no control on that situation but amount of users like that is really small

Thanks, your information helped me a lot.