tradingview/lightweight-charts-android

lateinit property histogramSeries has not been initialized

Ali1067 opened this issue · 8 comments

lateinit var histogramSeries: SeriesApi

charts_view.api.addHistogramSeries(
onSeriesCreated = { series ->
histogramSeries = series
}
)

the issue is, histogramSeries = series never called. any solution?

Hi! Can you make an example project with reproducing of this bug?

@makedonsky94 i just followed the instructions of their official git. (link attached). i'm building on android studio 2020.3.1 with kotlin.

https://github.com/tradingview/lightweight-charts-android

Can you check the version of WebView?

The library supports WebView implementations with version above 51. You can check it here

If you running the example in this repository on virtual device, there might be errors because of old implementations of WebView.

Using Chrome on Samsung Device which have Version 96.0.4664.45. (not working)
tested on emulator pixel5 . faced the same issue. would appreciate if you can please help to figure out.

I just realized that code in the screenshot is not expecting that series could be created asynchronously. The method addSeries is asynchronous and setting data should be placed in lambda onSeriesCreated

Resolved. Thanks for your help!