# Android does not load libfmodstudio.so

**URL:** <https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640>\
**Category:** Unity\
**Created:** [August 9, 2016, 10:44am UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640 "2016-08-09T10:44:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![123456](https://avatars.discourse-cdn.com/v4/letter/1/e480ec/32.png) [@123456](https://qa.fmod.com/u/123456)\
**Post date:** [August 9, 2016, 10:44am UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640/1 "2016-08-09T10:44:35Z")

</div>

Hi!  
I am using fmod studio in unity it works ok on osx and ios. But when I’m building for Android I got the following error:

D/dalvikvm( 4367): Trying to load lib /mnt/asec/com.ctdlgames.sonder6-2/lib/libfmodstudio.so 0x40f10d28  
E/dalvikvm( 4367): dlopen("/mnt/asec/com.ctdlgames.sonder6-2/lib/libfmodstudio.so") failed: Cannot load library: find\_library(linker.cpp:889): “/mnt/asec/com.ctdlgames.sonder6-2/lib/libfmodstudio.so” failed to load previously  
I/Unity ( 4367): AndroidJavaException: java.lang.UnsatisfiedLinkError: Cannot load library: find\_library(linker.cpp:889): “/mnt/asec/com.ctdlgames.sonder6-2/lib/libfmodstudio.so” failed to load previously  
I/Unity ( 4367): java.lang.UnsatisfiedLinkError: Cannot load library: find\_library(linker.cpp:889): “/mnt/asec/com.ctdlgames.sonder6-2/lib/libfmodstudio.so” failed to load previously

Any idea what might be causing this? Any help is appreciated.

Cheers!

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [August 10, 2016, 12:58am UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640/2 "2016-08-10T00:58:35Z")

</div>

> [@](#):
>
> Hi!  
> I am using fmod studio in unity it works ok on osx and ios. But when I’m building for Android I got the following error:
> 
> D/dalvikvm( 4367): Trying to load lib /mnt/asec/com.ctdlgames.sonder6-2/lib/libfmodstudio.so 0x40f10d28  
> E/dalvikvm( 4367): dlopen(“/mnt/asec/com.ctdlgames.sonder6-2/lib/libfmodstudio.so”) failed: Cannot load library: find\_library(linker.cpp:889): “/mnt/asec/com.ctdlgames.sonder6-2/lib/libfmodstudio.so” failed to load previously  
> I/Unity ( 4367): AndroidJavaException: java.lang.UnsatisfiedLinkError: Cannot load library: find\_library(linker.cpp:889): “/mnt/asec/com.ctdlgames.sonder6-2/lib/libfmodstudio.so” failed to load previously  
> I/Unity ( 4367): java.lang.UnsatisfiedLinkError: Cannot load library: find\_library(linker.cpp:889): “/mnt/asec/com.ctdlgames.sonder6-2/lib/libfmodstudio.so” failed to load previously
> 
> Any idea what might be causing this? Any help is appreciated.
> 
> Cheers!

Can you please specify which version of FMOD you are using and what version of Android you are running on. Have you confirmed that libfmodstudio.so is inside the APK (it can be opened with any zip file program) in the lib directory.

---

<div class="post-metadata">

**Author:** ![123456](https://avatars.discourse-cdn.com/v4/letter/1/e480ec/32.png) [@123456](https://qa.fmod.com/u/123456)\
**Post date:** [August 10, 2016, 9:34am UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640/3 "2016-08-10T09:34:35Z")

</div>

I am using unity integration ver. 1.08.05. Originally I have tried it on Android 4.2 and it didnt work. But today I run the same build on Android 4.3 and it was working fine. I checked the apk file and the library is there.

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [August 11, 2016, 3:49am UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640/4 "2016-08-11T03:49:58Z")

</div>

I tried an android 4.2.2 virtual device and it worked. Can you specify the device. Are there any earlier log messages that give a reason for the library not loading?

---

<div class="post-metadata">

**Author:** ![123456](https://avatars.discourse-cdn.com/v4/letter/1/e480ec/32.png) [@123456](https://qa.fmod.com/u/123456)\
**Post date:** [August 12, 2016, 10:51am UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640/5 "2016-08-12T10:51:56Z")

</div>

This is the first occurence of “libfmodstudio.so” and “libfmod.so” in my log file:

D/dalvikvm( 2448): Trying to load lib /mnt/asec/com.ctdlgames.sonder6-1/lib/libfmodstudio.so 0x422699f0  
E/dalvikvm( 2448): dlopen("/mnt/asec/com.ctdlgames.sonder6-1/lib/libfmodstudio.so") failed: Cannot load library: soinfo\_link\_image(linker.cpp:1635): could not load library “libfmod.so” needed by “libfmodstudio.so”; caused by load\_library(linker.cpp:745): library “libfmod.so” not found

and later (I think it might be relevant):

D/dalvikvm( 2448): Shared lib ‘/mnt/asec/com.ctdlgames.sonder6-1/lib/libfmod.so’ already loaded in same CL 0x422699f0

Obviously I checked and “libfmod.so” is present in the apk file.

I’am using colorovo CityTab Lite Model No.: CVT-CTL-7-DC#2.1

---

<div class="post-metadata">

**Author:** ![123456](https://avatars.discourse-cdn.com/v4/letter/1/e480ec/32.png) [@123456](https://qa.fmod.com/u/123456)\
**Post date:** [August 12, 2016, 11:13am UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640/6 "2016-08-12T11:13:54Z")

</div>

Also i have found this log

D/dalvikvm( 2561): Added shared lib /mnt/asec/com.ctdlgames.sonder6-1/lib/libfmod.so 0x42261d78

AFTER the first log from my previous post. This might cause the error?

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [August 15, 2016, 12:44am UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640/7 "2016-08-15T00:44:18Z")

</div>

Can you check to make sure the code in RuntimeUtils.EnforceLibraryOrder() is being run before any code that tries to use the FMOD libraries.

---

<div class="post-metadata">

**Author:** ![123456](https://avatars.discourse-cdn.com/v4/letter/1/e480ec/32.png) [@123456](https://qa.fmod.com/u/123456)\
**Post date:** [August 16, 2016, 12:03pm UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640/8 "2016-08-16T12:03:10Z")

</div>

Yep that was it. Strange that it was working on some androids but not on others. Anyways - thanks for support!

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [August 17, 2016, 12:09am UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640/9 "2016-08-17T00:09:24Z")

</div>

Automatic dependency loading was added in Android 4.4. Can you say what code was accessing FMOD functions before calling RuntimeUtils.EnforceLibraryOrder(), was it our code or yours?

---

<div class="post-metadata">

**Author:** ![123456](https://avatars.discourse-cdn.com/v4/letter/1/e480ec/32.png) [@123456](https://qa.fmod.com/u/123456)\
**Post date:** [August 17, 2016, 10:01am UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640/10 "2016-08-17T10:01:29Z")

</div>

Adding the previously mentioned call on Awake() did the job and first sounds are played in Start() function in my project so i suppose it was your code, it is hard for me to tell exact line thou.

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [August 18, 2016, 12:33am UTC](https://qa.fmod.com/t/android-does-not-load-libfmodstudio-so/12640/11 "2016-08-18T00:33:50Z")

</div>

Solved in the comments by explicitly calling RuntimeUtils.EnforceLibraryOrder() in the awake() phase of Unity. This issue only affects Android phones before 4.4.
