# Android native not initializing

**URL:** <https://qa.fmod.com/t/android-native-not-initializing/12034>\
**Category:** FMOD Engine\
**Created:** [August 30, 2015, 7:59pm UTC](https://qa.fmod.com/t/android-native-not-initializing/12034 "2015-08-30T19:59:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JakeSimpson1](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@JakeSimpson1](https://qa.fmod.com/u/JakeSimpson1)\
**Post date:** [August 30, 2015, 7:59pm UTC](https://qa.fmod.com/t/android-native-not-initializing/12034/1 "2015-08-30T19:59:21Z")

</div>

I’ve got the jar in the right place for the android build (doing it all at the command line since Eclipse is _such_ a piece of crap, and I just don’t trust android studio), and I’m doing the init for fmod of the java lib in java (in the Activity Extender, as the docs recommend), even though my understanding is that I only need to do this if I intend to load audio files in the native lib from the bundle (I’m not doing that - I’ve already decompressed the files in memory, since I have my own file loading system). Just in case.

I’m doing this to init the system in C++ code.

FMOD\_System\_Init(mFModSystem, 128, FMOD\_INIT\_NORMAL, 0);

after successfully creating the system and putting the system pointer in mFModSystem, and I get an error 28 back from this on Android (works fine on everything else).

Error 28 appears to be FMOD\_ERR\_INTERNAL, which is “an error occurred that wasn’t supposed to. Contact Support”. So here I am, contacting support.

I’m running Android 5.1.1 on a Nexus 5, using FMOD low level api version 10608 for android.

I’m targeting NDK and SDK version 21 in my build.

I’ve tried playing with the number of channels it’s asking for (originally it was 512) and still no joy. Everything compiles just fine, it just won’t initialize and I’ve no clue why.

---

<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:** [September 1, 2015, 3:35am UTC](https://qa.fmod.com/t/android-native-not-initializing/12034/2 "2015-09-01T03:35:15Z")

</div>

> [@](#):
>
> I’ve got the jar in the right place for the android build (doing it all at the command line since Eclipse is _such_ a piece of crap, and I just don’t trust android studio), and I’m doing the init for fmod of the java lib in java (in the Activity Extender, as the docs recommend), even though my understanding is that I only need to do this if I intend to load audio files in the native lib from the bundle (I’m not doing that - I’ve already decompressed the files in memory, since I have my own file loading system). Just in case.
> 
> I’m doing this to init the system in C++ code.
> 
> FMOD\_System\_Init(mFModSystem, 128, FMOD\_INIT\_NORMAL, 0);
> 
> after successfully creating the system and putting the system pointer in mFModSystem, and I get an error 28 back from this on Android (works fine on everything else).
> 
> Error 28 appears to be FMOD\_ERR\_INTERNAL, which is “an error occurred that wasn’t supposed to. Contact Support”. So here I am, contacting support.
> 
> I’m running Android 5.1.1 on a Nexus 5, using FMOD low level api version 10608 for android.
> 
> I’m targeting NDK and SDK version 21 in my build.
> 
> I’ve tried playing with the number of channels it’s asking for (originally it was 512) and still no joy. Everything compiles just fine, it just won’t initialize and I’ve no clue why.

Can you try linking with the logging version of FMOD? The LogCat output will explain why you are getting that error.

---

<div class="post-metadata">

**Author:** ![JakeSimpson1](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@JakeSimpson1](https://qa.fmod.com/u/JakeSimpson1)\
**Post date:** [September 2, 2015, 4:26pm UTC](https://qa.fmod.com/t/android-native-not-initializing/12034/3 "2015-09-02T16:26:24Z")

</div>

I feel about as stupid as it’s possible to feel for not thinking of doing that myself.

DOH!

Thanks Matthew.

Ok, so it’s telling me JNI\_OnLoad has not run.

I need to look at some of the documentation then, see what I’m supposed to do here.

---

<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:** [September 8, 2015, 5:25am UTC](https://qa.fmod.com/t/android-native-not-initializing/12034/4 "2015-09-08T05:25:02Z")

</div>

> [@](#):
>
> I feel about as stupid as it’s possible to feel for not thinking of doing that myself.
> 
> DOH!
> 
> Thanks Matthew.
> 
> Ok, so it’s telling me JNI\_OnLoad has not run.
> 
> I need to look at some of the documentation then, see what I’m supposed to do here.

It’s likely that you aren’t using System.loadLibrary from Java on the FMOD libs. This is necessary to ensure that the JNI\_OnLoad is run for that module.
