lapserdak lapserdak - 1 year ago 110
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, 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

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

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 Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download