Answered
0
0

Hi all,

I’m currently porting to Android a C++ game made with FMod4/FModDesigner.
I’m using a Visual Studio 2015 Android Native Activity project.
The game runs fine with all sound code disabled, and I’m having trouble when linking with fmod .so files.
My problems may come from my misunderstanding of the Visual Studio process, but someone may be able to help ?

Details :
I added libfmodex.so and libfmodevent.so to the linker command line of the .NativeActivity project.
I also added both to the .Packaging project in a libs/armeabi-v7a folder.
They are added to the .apk in lib/armeabi-v7a, next to my app .so file.
I run the application with no other modification (no Java System.load, no native dlopen).
It immedialty crashes and stops, without even reaching the typical NativeActivity_OnCreate.

Sadly, I could not find any relevant information in Logcat.
I’m using Android API level 19.

I also tried to add following Java library loading code (which seems actually added to the classes.dex), but it did not help.

public class LoadFMod
{
    static 
    {
        System.load("fmodex");
        System.load("fmodevent");
    }
}

Any help available ?

Thanks

  • You must to post comments
Best Answer
0
0

I could make it work, the solution was in loading library from the actual native activity Java class :

package com.MyPackage;
public class MyNativeActivity extends android.app.NativeActivity
{
    static 
    {
        System.load("fmodex");
        System.load("fmodevent");
    }
}

Do not forget to specify it in the AndroidManifest.xml

  <activity android:name="com.MyPackage.MyNativeActivity"
        android:label="@string/app_name"
        ...

Enjoy !

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.