lapserdak lapserdak - 7 months ago 33
Java Question

Superpowered Library linking doesn't work

I try add superpowered library to new android studio project and I follow example for Android but I still have problems with linking library.

I have this error:


java.lang.UnsatisfiedLinkError: No implementation found for void com.xxx.audiomixprototype.MainActivity.AudioMixPrototype(java.lang.String, long[]) (tried Java_com_xxx_audiomixprototype_MainActivity_AudioMixPrototype and Java_com_xxx_audiomixprototype_MainActivity_AudioMixPrototype__Ljava_lang_String_2_3J)


I follow short tutorial from Superpowered github readme
https://github.com/superpoweredSDK/Low-Latency-Android-Audio-iOS-Audio-Engine

and everything is clear but I don't understand last point:


create your custom .cpp and .h files, then donÕt forget to properly set LOCAL_MODULE and LOCAL_SRC_FILES in Android.mk


Probably this is the reason why I can't link correctly this library. Any solutions how properly set LOCAL_MODULE and LOCAL_SRC_FILES?

Answer

Ok I found the solution. When I copy SuperpoweredExample.cpp file I didn't change JNIEXPORT in this file.

I have this:

JNIEXPORT void Java_com_superpowered_crossexample_MainActivity_SuperpoweredExample(JNIEnv *javaEnvironment, jobject self, jstring apkPath, jlongArray offsetAndLength);

Instead this:

JNIEXPORT void Java_com_xxx_audiomixprototype_MainActivity_SuperpoweredExample(JNIEnv *javaEnvironment, jobject self, jstring apkPath, jlongArray offsetAndLength);

I know stupid mistake but maybe someone else will have the same problem.

Comments