Pre loader

java.lang.UnsatisfiedLinkError crash report

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

We published an update with SciChart included and just got 2 crash reports with “UnsatisfiedLinkError”. It happened on Doogee Shoot_ 1 (Shoot_1), Android 6.0. What is happening here and how do I fix it? The crash ocurs when we try to set runtime license key:

java.lang.UnsatisfiedLinkError: 
  at java.lang.Runtime.loadLibrary (Runtime.java:367)
  at java.lang.System.loadLibrary (System.java:1076)
  at com.scichart.core.utility.NativeLibraryHelper.tryLoadLibrary (SourceFile:39)
  at com.scichart.core.licensing.LibsodiumNativeWrapper.<clinit> (SourceFile:29)
  at com.scichart.core.licensing.Decoder.<init> (SourceFile:159)
  at com.scichart.core.licensing.Credentials.setRuntimeLicenseKey (SourceFile:55)
  at com.scichart.charting.visuals.SciChartSurface.setRuntimeLicenseKey (SourceFile:247)
  at com.my.app.MainApplication.activateSciChart (MainApplication.java:158)
  at com.my.app.MainApplication.onCreate (MainApplication.java:76)
  at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1018)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:4969)
  at android.app.ActivityThread.-wrap1 (ActivityThread.java)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1559)
  at android.os.Handler.dispatchMessage (Handler.java:111)
  at android.os.Looper.loop (Looper.java:207)
  at android.app.ActivityThread.main (ActivityThread.java:5750)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:789)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:679)

Second report (Huawei P20, Android 9):

java.lang.UnsatisfiedLinkError: 
  at java.lang.Runtime.loadLibrary0 (Runtime.java:1012)
  at java.lang.System.loadLibrary (System.java:1672)
  at com.scichart.core.utility.NativeLibraryHelper.tryLoadLibrary (SourceFile:39)
  at com.scichart.core.licensing.LibsodiumNativeWrapper.<clinit> (SourceFile:29)
  at com.scichart.core.licensing.LibsodiumNativeWrapper.a (SourceFile:41)
  at com.scichart.core.licensing.Decoder.<init> (SourceFile:159)
  at com.scichart.core.licensing.Credentials.setRuntimeLicenseKey (SourceFile:55)
  at com.scichart.charting.visuals.SciChartSurface.setRuntimeLicenseKey (SourceFile:247)
  at com.my.app.MainApplication.activateSciChart (MainApplication.java:158)
  at com.my.app.MainApplication.onCreate (MainApplication.java:76)
Version
2.2.2.2410
  • Mike Liu
    +1, seeing this crash on Moto G (5) Plus, Android 8.1.0. It’s 100% repro for one of my users who reached out to me via e-mail. Is there some way to catch this exception to suppress it so they can continue using the app? I do not use App Bundle, but I do use ProGuard.
  • Yura Khariton
    Can you provide a project which reproduces this issue? It’s a very tricky issue and you can’t just catch and supress it because it’s thrown when some C++ library can’t be loaded for some reason and you’ll see other exceptions every time Java code will try to call native C++ code. This exception could be caused by changing of string with library name on Java side so loadLibrary() can’t find file with C++ library in application resources or it could be changed by changing name or removing of C++ library from resources. That’s why I asked about ProGuard, which can obfuscate Java code and remove ‘unused’ resources ( which in your case are actually used ) during minification of application, and App Bundle which, as I know, allows to shrink APK size by downloading only required parts of application ( based on information that this issue occurs only on some devices I guess on those devices something goes wrong during this process – maybe device requests C++ library for wrong CPU architecture or it doesn’t request it at all). Also it could be caused by something else so without solution which allows us to reproduce this issue it would be very hard to fix it because we won’t know what causes it and as result we won’t be able to determine when the issue is fixed.
  • Mike Liu
    This only repros on a few devices for me, out of hundreds of thousands, so it’s not possible to provide a consistent repro with a sample project, only through crash analysis. It is the biggest crasher in my app. What are the steps to mitigate / work around this issue? Could you provide steps to disable SciChart on devices where it crashes?
  • Andrew Burnett-Thompson
    Above code looks like call to Licensing which is a C++ module. Might give some clues.
  • Andrew Burnett-Thompson
    Mike Liu see my answer I just added to this forum question. Best regards, Andrew
1
0

The above is very hard to reproduce judging by the comments above and seems like a call to licensing looking at the stack trace.

Mike I’d suggest to you since you have a source code license. Include Source-code for SciChart in your application and compile it. The source-code version of SciChart has licensing removed. Then you no longer need to call SetRuntimeLicenseKey

Primoz, your support is expired and you don’t have a source-code license, you won’t be able to get help in either case I’m afraid.

If we get a repro of some kind we will fix it. We want SciChart to be the best Android charts and be stable on all devices.

Best regards,
Andrew

  • Mike Liu
    Seems like I may need to do something like mentioned in this thread: https://stackoverflow.com/questions/25360769/how-do-i-catch-a-static-java-lang-unsatisfiedlinkerror-from-android-and-show-the. I am okay with disabling SciChart on devices where this crash happens for now, since it’s a very low amount of devices.
  • Andrew Burnett-Thompson
    Hi Mike, OK gives us more info. Seems any time that we call C++ code (which is in a few places: performance oriented sections as well as licensing) we get this error. OK I will flag this up for further investigation by the team. Best regards, Andrew
  • Andrew Burnett-Thompson
    It’s important for us to fix as 3D Charts will depend a lot on C++. Keep in contact as we work on this.
  • Primoz
    Hi Andrew, thanks for the input. Seems Mike provided some more clues which should help to sort this.
  • Yura Khariton
    Can you provide information about devices where this issue occurs ( e.g. devices specs, version of Android, locale settings etc )?
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies