# Seeing a new Android crash when calling System.loadLibrary("fmodstudio")

**URL:** <https://qa.fmod.com/t/seeing-a-new-android-crash-when-calling-system-loadlibrary-fmodstudio/19158>\
**Category:** FMOD Studio\
**Created:** [August 18, 2022, 6:03pm UTC](https://qa.fmod.com/t/seeing-a-new-android-crash-when-calling-system-loadlibrary-fmodstudio/19158 "2022-08-18T18:03:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vectorunit](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@vectorunit](https://qa.fmod.com/u/vectorunit)\
**Post date:** [August 18, 2022, 6:03pm UTC](https://qa.fmod.com/t/seeing-a-new-android-crash-when-calling-system-loadlibrary-fmodstudio/19158/1 "2022-08-18T18:03:41Z")

</div>

Hi, we’re seeing a new Android crash after (1) switching from NDK r22b to r23b, and (2) integrating firebase crashlytics.

This is being reported on SDK 27-31, but it’s too early to get a device breakdown.

The stack trace is below, and is triggered by calling

System.loadLibrary(“fmodstudio”); (MainActivity.java:53)

It’s currently the most prominent crash in our latest update, but still somewhat rare, and not reproducible locally.

Does this ring any bells?

Thanks

```auto
Exception java.lang.ExceptionInInitializerError:
  at java.lang.Class.newInstance
  at android.app.AppComponentFactory.instantiateActivity (AppComponentFactory.java:69)
  at android.app.Instrumentation.newActivity (Instrumentation.java:1216)
  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2902)
  at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3119)
  at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:78)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:108)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:68)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1839)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:201)
  at android.app.ActivityThread.main (ActivityThread.java:6861)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:547)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:873)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.indexOf(int)' on a null object reference
  at java.lang.Runtime.loadLibrary0 (Runtime.java:999)
  at java.lang.System.loadLibrary (System.java:1669)
  at com.vectorunit.cobalt.googleplay.MainActivity.<clinit> (MainActivity.java:53)

```

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [August 25, 2022, 12:51am UTC](https://qa.fmod.com/t/seeing-a-new-android-crash-when-calling-system-loadlibrary-fmodstudio/19158/2 "2022-08-25T00:51:33Z")

</div>

> [@vectorunit](#):
>
> System.loadLibrary(“fmodstudio”); (MainActivity.java:53)

`java.lang.UnsatisfiedLinkError` is a case we have seen before for missing libs but not `java.lang.NullPointerException`. According to the docs on [System.loadLibrary](https://developer.android.com/reference/java/lang/System#loadLibrary(java.lang.String)) / [Runtime.loadLibrary](https://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#loadLibrary(java.lang.String)) that exception is thrown when the `libname` argument is null, but you are passing it a hardcoded string so I don’t see how that could be the case.  
Are you calling `System.loadLibrary` from a [static initializer](https://fmod.com/docs/2.02/api/platforms-android.html#java) or somewhere else?

---

<div class="post-metadata">

**Author:** ![vectorunit](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@vectorunit](https://qa.fmod.com/u/vectorunit)\
**Post date:** [August 25, 2022, 1:22am UTC](https://qa.fmod.com/t/seeing-a-new-android-crash-when-calling-system-loadlibrary-fmodstudio/19158/3 "2022-08-25T01:22:09Z")

</div>

Static… here’s the code in my activity:

```auto
static 
{
	System.loadLibrary("fmod");
	System.loadLibrary("fmodstudio");
}

```

---

<div class="post-metadata">

**Author:** ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)\
**Post date:** [August 25, 2022, 4:33am UTC](https://qa.fmod.com/t/seeing-a-new-android-crash-when-calling-system-loadlibrary-fmodstudio/19158/4 "2022-08-25T04:33:47Z")

</div>

Yep, those values aren’t null. I think wait until you can get a device breakdown and then try reproing it. This isn’t something we’ve seen before and there’s nothing really for us to go off in that stack trace. What version of FMOD are you using?
