# FMOD::System::init crash in Android

**URL:** <https://qa.fmod.com/t/fmod-init-crash-in-android/11915>\
**Category:** FMOD Engine\
**Created:** [May 13, 2015, 9:28pm UTC](https://qa.fmod.com/t/fmod-init-crash-in-android/11915 "2015-05-13T21:28:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chmeyer\_ms](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@chmeyer\_ms](https://qa.fmod.com/u/chmeyer_ms)\
**Post date:** [May 13, 2015, 9:28pm UTC](https://qa.fmod.com/t/fmod-init-crash-in-android/11915/1 "2015-05-13T21:28:34Z")

</div>

Running into a crash with FMOD Studio (low level api) version 10602 on Android.

Here’s the output from LogCat. Project is building against SDK19. I saw a similar post that seemed to indicate fmod.jar not in “Order and Export” so I verified that I do in fact have this set.

I/fmod(31561): [LOG] SystemI::init : FMOD Studio Version: 00010602 (63981)

I/fmod(31561): [LOG] SystemI::init : maxchannels = 32, flags = 00000000, extradriverdata = 0x0

I/fmod(31561): [LOG] SystemI::close :

I/fmod(31561): [LOG] SystemI::close : Stop all sounds

I/fmod(31561): [LOG] SystemI::close : Remove miscllaneous DSP stuff.

I/fmod(31561): [LOG] SystemI::close : done.

I/fmod(31561): [LOG] FMOD\_OS\_Init : Detected Neon instruction support, will use Neon optimized mixing and resampling.

I/fmod(31561): [ERR] AndroidAssetFile::registerLib : JavaVM::GetEnv returned -2.

I/fmod(31561): [ERR] FMOD\_OS\_Output\_GetDefault : JavaVM::GetEnv returned -2.

I/fmod(31561): [ERR] assert : assertion: ‘mOutput’ failed

A/libc(31561): Fatal signal 11 (SIGSEGV) at 0x00000018 (code=1)

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [May 14, 2015, 1:14am UTC](https://qa.fmod.com/t/fmod-init-crash-in-android/11915/2 "2015-05-14T01:14:40Z")

</div>

This is most likely due to the thread you are calling FMOD on not being attached to the Java VM. This can happen if you are using a native activity application.

I will improve the error reporting and platform documentation to better reflect this for a future version.

The required JNI API is AttachCurrentThread, this will allow FMOD to make calls into Java.

---

<div class="post-metadata">

**Author:** ![LemonTree](https://avatars.discourse-cdn.com/v4/letter/l/dbc845/32.png) [@LemonTree](https://qa.fmod.com/u/LemonTree)\
**Post date:** [September 4, 2019, 8:25am UTC](https://qa.fmod.com/t/fmod-init-crash-in-android/11915/3 "2019-09-04T08:25:18Z")

</div>

Hi  
When I use FMOD\_System\_Init to initialize the system, the return value is FMOD\_ERR\_NEEDSHARDWARE. I don’t know why it failed. My code：  
FMOD\_INITFLAGS initFlags = FMOD\_INIT\_NORMAL | FMOD\_INIT\_3D\_RIGHTHANDED | FMOD\_INIT\_VOL0\_BECOMES\_VIRTUAL;  
result = FMOD\_System\_Init(SoundUtil::FMODSystem, 100, initFlags, 0);  
, is some initflag have hardware limitation?

---

<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:** [September 10, 2019, 4:06am UTC](https://qa.fmod.com/t/fmod-init-crash-in-android/11915/4 "2019-09-10T04:06:17Z")

</div>

It would be best to start a new thread, and link back to this one if you really need to.

Can you please also provide the FMOD version you are using.

---

<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:** [September 10, 2019, 4:06am UTC](https://qa.fmod.com/t/fmod-init-crash-in-android/11915/5 "2019-09-10T04:06:23Z")

</div>


