2

I'm getting an error on Galaxy S6 Edge+ where it says it can't load native library. I'm using CSipSimple. It compiles fine if i don't include the arm64-v8a in the Application.mk file. I'm gettings this error:

[arm64-v8a] StaticLibrary  : libpj_amr_stagefright_codec.a
[arm64-v8a] StaticLibrary  : libpjsip.a
[arm64-v8a] Compile        : pjmedia <= echo_webrtc_aec.c
In file included from jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/../../../webrtc/sources/modules/audio_processing/aec/include/echo_cancellation.h:14:0,
                 from jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/src/pjmedia/echo_webrtc_aec.c:57:
jni/pjsip/android_toolchain/pjmedia/../../sources/pjmedia/../../../webrtc/sources/typedefs.h:61:2: error: #error Please add support for your architecture in typedefs.h
 #error Please add support for your architecture in typedefs.h
  ^
make[1]: *** [obj/local/arm64-v8a/objs/pjmedia/src/pjmedia/echo_webrtc_aec.o] Error 1
make[1]: *** Waiting for unfinished jobs....
rm jni/swig-glue/android_toolchain/../.pjsua.i
make[1]: Leaving directory `/home/user/data/svn/CSipSimple-trunk/CSipSimple'
make: *** [libraries] Error 2

Here's the portion of the make file (I'll include it in case messed it up):

 JNI_DIR := $(call my-dir)

 APP_OPTIM := release APP_ABI := armeabi armeabi-v7a x86 mips arm64-v8a

 MY_USE_CSIPSIMPLE := 1

 MY_USE_G729 := 1

I'm using the Android NDK r10e-rc4, if that helps.

Edit 1: I also tried building using the following commands in order: svn update, make clean, make udpate, make

hadez30
  • 503
  • 5
  • 18

1 Answers1

0

I have the same problem. It looks like the code from WebRTC didn't support arm64-v8a yet.

Apply the patch below to 'webrtc/sources/typedefs.h' from your error message can fix this build break.

 #define WEBRTC_ARCH_32_BITS
 #define WEBRTC_ARCH_LITTLE_ENDIAN
 #define WEBRTC_LITTLE_ENDIAN
+#elif defined(__aarch64__)
+#define WEBRTC_ARCH_64_BITS
+#define WEBRTC_ARCH_LITTLE_ENDIAN
+#define WEBRTC_LITTLE_ENDIAN
 #elif defined(__MIPSEL__)
 #define WEBRTC_ARCH_32_BITS
 #define WEBRTC_ARCH_LITTLE_ENDIAN

also see: https://android.googlesource.com/platform/external/webrtc/+/android-6.0.1_r41/src/typedefs.h

note, the code from the link above doesn't contain #define WEBRTC_LITTLE_ENDIAN, but in the version of my code, WEBRTC_LITTLE_ENDIAN and WEBRTC_ARCH_LITTLE_ENDIAN come in pairs. so I think it depends on version.

simpx
  • 184
  • 1
  • 11