我能够使用一组NDK和NDK-build命令成功编译PJSIP库并将其与Android集成。我创建了,所以Eclipse中的一个新项目,以原始示例为蓝本。但是,我还不了解如何操作NDK,因此我不知道如何配置Android.mk。目前在文件夹'jni'中的是Android.mk文件的内容:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libpjsua
LOCAL_SRC_FILES := $(MY_JNI_WRAP) libpjsua-arm-unknown-linux-androidabi.a
include $(PREBUILT_STATIC_LIBRARY)
LOCAL_STATIC_LIBRARIES := libpjsua
相反,文件夹'libs'包含子文件夹'armeabi',其中有一个文件libpjsua.so
我认为这已经足够了,但是LogCat是一个不同的观点:
> 01-18 18:58:03.339: E/AndroidRuntime(31113): FATAL EXCEPTION: main
01-18 18:58:03.339: E/AndroidRuntime(31113): java.lang.ExceptionInInitializerError
01-18 18:58:03.339: E/AndroidRuntime(31113): at com.example.myactivity.PjsuaAppCallback.<init>(PjsuaAppCallback.java:62)
01-18 18:58:03.339: E/AndroidRuntime(31113): at com.example.myactivity.Breakthrough$MyCallback.<init>(MainActivity.java:87)
01-18 18:58:03.339: E/AndroidRuntime(31113): at com.example.myactivity.Breakthrough.init_lib(MainActivity.java:205)
01-18 18:58:03.339: E/AndroidRuntime(31113): at com.example.myactivity.Breakthrough.onCreate(MainActivity.java:131)
01-18 18:58:03.339: E/AndroidRuntime(31113): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-18 18:58:03.339: E/AndroidRuntime(31113): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1623)
01-18 18:58:03.339: E/AndroidRuntime(31113): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
01-18 18:58:03.339: E/AndroidRuntime(31113): at android.app.ActivityThread.access$1500(ActivityThread.java:121)
01-18 18:58:03.339: E/AndroidRuntime(31113): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
01-18 18:58:03.339: E/AndroidRuntime(31113): at android.os.Handler.dispatchMessage(Handler.java:99)
01-18 18:58:03.339: E/AndroidRuntime(31113): at android.os.Looper.loop(Looper.java:130)
01-18 18:58:03.339: E/AndroidRuntime(31113): at android.app.ActivityThread.main(ActivityThread.java:3768)
01-18 18:58:03.339: E/AndroidRuntime(31113): at java.lang.reflect.Method.invokeNative(Native Method)
01-18 18:58:03.339: E/AndroidRuntime(31113): at java.lang.reflect.Method.invoke(Method.java:507)
01-18 18:58:03.339: E/AndroidRuntime(31113): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
01-18 18:58:03.339: E/AndroidRuntime(31113): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
01-18 18:58:03.339: E/AndroidRuntime(31113): at dalvik.system.NativeStart.main(Native Method)
01-18 18:58:03.339: E/AndroidRuntime(31113): Caused by: java.lang.UnsatisfiedLinkError: swig_module_init
01-18 18:58:03.339: E/AndroidRuntime(31113): at com.example.myactivity.PjsuaNative.swig_module_init(Native Method)
01-18 18:58:03.339: E/AndroidRuntime(31113): at com.example.myactivity.PjsuaNative.<clinit>(PjsuaNative.java:49)
01-18 18:58:03.339: E/AndroidRuntime(31113): ... 17 more
我发现了这个 - &gt; sip - How to use pjsip on android device in order to have G.729 codec functionality但是尽管用户的答案'jcm'仍然不明白如何配置文件.mk
请帮助和问候。