PhilJay / MPAndroidChart

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Other
37.52k stars 9.01k forks source link

Native Crash from android.graphics.Paint #3769

Open devGeanina opened 6 years ago

devGeanina commented 6 years ago

The app crashes after a few minutes with this native crash on devices running a 7+ version: [A/art: art/runtime/java_vm_ext.cc:470] JNI DETECTED ERROR IN APPLICATION: thread Thread[1,tid=2448,Runnable,Thread*=0xb1705400,peer=0x746f7918,"main"] using JNI after critical get in call to DeleteGlobalRef from float android.graphics.Paint.nGetRunAdvance(long, long, char[], int, int, int, int, boolean, int) Is the library tested for this kind of devices? Any idea for a fix?

MerlinYu commented 6 years ago

I also meet this problem,do you have any ideas ?

devGeanina commented 6 years ago

I discovered the problem was actually from another library, EasyFonts. Also there appears to be some problems with the downloaded fonts that you set with fontfamily in your xmls. Maybe that can help you. Pe 26.02.2018 04:21, "Merlin" notifications@github.com a scris:

I also meet this problem,do you have any ideas ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PhilJay/MPAndroidChart/issues/3769#issuecomment-368371686, or mute the thread https://github.com/notifications/unsubscribe-auth/AiSfx2ZVZZYXjZF07ls0NaEF191NgI5Rks5tYhUqgaJpZM4Rx_k6 .

reaper commented 6 years ago

Someone has found what is causing this issue ?

19chang19 commented 2 years ago

I also meet this problem

Skaldebane commented 1 year ago

Seems like this is an issue in Android code. I face this on an Android 8.1 emulator, and I'm not using this library. I'm simply creating multiple Typeface objects from a few files, and showing them in a list in the screen.

After some scrolling, this exact problem happens. Using Jetpack Compose (LazyColumn), reproducing it is easy in a few scrolls, while using Views (RecyclerView) it's less frequent, but it still happens anyways.

I suspect the native Android code for font rendering has a bug, most likely related to pointers and memory management (as usual with native C/C++ code). It may also be limited to emulators, I don't have a physical Android 8 device to check that.

Edit. couldn't reproduce on an Android 13 emulator.