Android native not initializing

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.

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


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.