# FMOD causing crash on Android

**URL:** <https://qa.fmod.com/t/fmod-causing-crash-on-android/14935>\
**Category:** Unity\
**Created:** [August 9, 2019, 11:13pm UTC](https://qa.fmod.com/t/fmod-causing-crash-on-android/14935 "2019-08-09T23:13:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bug5532](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Bug5532](https://qa.fmod.com/u/Bug5532)\
**Post date:** [August 9, 2019, 11:13pm UTC](https://qa.fmod.com/t/fmod-causing-crash-on-android/14935/1 "2019-08-09T23:13:52Z")

</div>

Works fine on pc and in editor. But when I deploy to an android device the first time I play a sound the entire game freezes up. If I then reboot the game it all works fine.  
Any idea what can be causing this?

---

<div class="post-metadata">

**Author:** ![KarateKidzz](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@KarateKidzz](https://qa.fmod.com/u/KarateKidzz)\
**Post date:** [August 10, 2019, 10:34pm UTC](https://qa.fmod.com/t/fmod-causing-crash-on-android/14935/2 "2019-08-10T22:34:07Z")

</div>

I have two ideas.

1. You’re loading files straight from disk without FMOD Studio and are not using the correct prefix. I can’t remember the exact wording but it’s something like “file:///your\_file.ogg”. There should be some docs on it. At the very least, the Unity integration shows this prefix in the `RuntimeManager.cs` class during `LoadBank` calls.

2. The audio is loaded on the main thread and hangs until complete.

But you haven’t given much information, nor explained any debugging you’ve done so I can’t say anything with much certainty.

---

<div class="post-metadata">

**Author:** ![KarateKidzz](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@KarateKidzz](https://qa.fmod.com/u/KarateKidzz)\
**Post date:** [August 10, 2019, 10:39pm UTC](https://qa.fmod.com/t/fmod-causing-crash-on-android/14935/3 "2019-08-10T22:39:47Z")

</div>

`file:///android_asset` is the correct prefix

---

<div class="post-metadata">

**Author:** ![ethan.tqa](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@ethan.tqa](https://qa.fmod.com/u/ethan.tqa)\
**Post date:** [September 28, 2019, 7:59am UTC](https://qa.fmod.com/t/fmod-causing-crash-on-android/14935/4 "2019-09-28T07:59:44Z")

</div>

Our game is facing the same problem on Android, the moment the first audio is played, the whole game hangs. Crash at vdso without any further backtrace. It does not always happen, but when it does, it’s almost always the first audio. We use 64-bit IL2CPP.  
Update: [This seems to be a fix for the problem](https://qa.fmod.com/t/delayed-fmod-initialization-for-fix-crash-on-android-8-0/15046)

---

<div class="post-metadata">

**Author:** ![Bug5532](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Bug5532](https://qa.fmod.com/u/Bug5532)\
**Post date:** [October 3, 2019, 11:33pm UTC](https://qa.fmod.com/t/fmod-causing-crash-on-android/14935/5 "2019-10-03T23:33:55Z")

</div>

So my issue seems to be when I have both FMOD and Unity Ads enabled. If I initiate the Ads there is a chance the game will just freeze up. The solution Ethan linked to doesn’t help as I’m on Android 9.

If I disable the Ads, no crashes, if I disable the sounds, no crashes. Both enabled I get crashes ☹  
Bit lost what to try next now…

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [October 7, 2019, 12:32am UTC](https://qa.fmod.com/t/fmod-causing-crash-on-android/14935/6 "2019-10-07T00:32:02Z")

</div>

Is it crashing in FMOD? Have you been able to get any logs or crash dumps?

---

<div class="post-metadata">

**Author:** ![Bug5532](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Bug5532](https://qa.fmod.com/u/Bug5532)\
**Post date:** [October 7, 2019, 10:04am UTC](https://qa.fmod.com/t/fmod-causing-crash-on-android/14935/7 "2019-10-07T10:04:26Z")

</div>

No, there was nothing useful at all in the logcat.  
After further investigation though it seems to only happen when I click “Build and run” in unity. If I install the app via apk or google play, or even reopen the app once installed by unity it all works fine. So I’ve given up the hunt for it now.
