I am creating an Android application. Encode and decode with Opus codec. I use the native code here http://www.opus-codec.org/ and the wrapper from here https://github.com/jitsi/libjitsi/tree/master/src/native/opus . In Android 4.0+, I created a .so file and ran it, everything is fine. but in Android 5.0, it crashes when I call my own method. Here is the detail of the accident:
java.lang.UnsatisfiedLinkError: No implementation found for long my.package.name.codec.Opus.encoder_create(int, int) (tried Java_my_package_name_codec_Opus_encoder_1create and Java_my_package_name_codec_Opus_encoder_1create__II)
I am also looking for a lot, but I can not find the root cause, and I do not have the same problem. below is my mk file, I think it is useful.
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) MY_MODULE_DIR := opus LOCAL_MODULE := $(MY_MODULE_DIR) LOCAL_SRC_FILES := $(wildcard ( libopus/src/*.c \ libopus/celt/*.c \ libopus/celt/arm/*.c \ libopus/silk/*.c \ libopus/silk/arm/*.c \ libopus/include/*.c \ libopus/silk/fixed/*.c \ my_package_name_codec_Opus.c )) LOCAL_C_INCLUDES := \ libopus/src \ libopus/include \ libopus/silk \ libopus/silk/fixed \ libopus/silk/arm \ libopus/celt \ libopus/celt/arm \ libopus \ LOCAL_CFLAGS := -DNULL=0 -DSOCKLEN_T=socklen_t -DLOCALE_NOT_USED -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 LOCAL_CFLAGS += -Drestrict='' -D__EMX__ -DOPUS_BUILD -DFIXED_POINT -DUSE_ALLOCA -DHAVE_LRINT -DHAVE_LRINTF -O3 -fno-math-errno LOCAL_CPPFLAGS := -DBSD=1 LOCAL_CPPFLAGS += -ffast-math -O3 -funroll-loops include $(BUILD_SHARED_LIBRARY)
PS: if you need more files, please let me know.
source share