我成功编译了Android的PJSIP库。当我为默认架构armeabi构建时,示例项目没有任何问题。现在我尝试编译arch for arch,例如armeabi-v7a和arm64-v8a。不幸的是,当我在适当的文件夹(jnLibs / armeabi-v7a和jniLibs / arm64-v8a)中添加库时,应用程序无法启动......
要为不同的archs设置构建,我使用以下命令:
NDK_TOOLCHAIN_VERSION=4.9 TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags
我在应用启动时遇到此错误:
07-04 12:28:46.079 15317-15317/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.futuremind.omili, PID: 15317
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "getifaddrs" referenced by "/data/app/com.futuremind.omili-1/lib/arm/libpjsua2.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at com.futuremind.omili.MyApp.<clinit>(MyApp.java:293)
at com.futuremind.omili.MainActivity.onCreate(MainActivity.java:87)
at android.app.Activity.performCreate(Activity.java:6289)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2405)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2535)
at android.app.ActivityThread.access$900(ActivityThread.java:155)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1380)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5497)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
感谢您的帮助! :)
答案 0 :(得分:1)
我能够通过更新“ pjsip-apps / src / src / swig / java / android / app / src / main”中的AndroidManifest.xml以匹配我的android目标(在我的情况下为“ 23”)来解决此错误。然后在“ pjsip-apps / src / swig”中“ make clean”和另一个“ make”,并重建我的应用。