无法加载库:reloc_library [1285]:无法找到“兰特” [英] Cannot load library: reloc_library[1285]: cannot locate 'rand'
问题描述
我试图用PJSIP库我的Android应用程序。 我按照本手册内置pjsua示例应用程序: <一href="https://trac.pjsip.org/repos/wiki/Getting-Started/Android">https://trac.pjsip.org/repos/wiki/Getting-Started/Android
I'm trying to use PJSIP library for my Android application. I built pjsua sample application according to this manual: https://trac.pjsip.org/repos/wiki/Getting-Started/Android
但是,当样本应用程序启动,异常触发:
But when sample application is launching, exception triggers:
12-06 15:03:58.043: D/dalvikvm(628): Trying to load lib /data/data/org.pjsip.pjsua2.app/lib/libpjsua2.so 0x4129d980
12-06 15:03:58.064: W/dalvikvm(628): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/pjsip/pjsua2/app/MyApp;
12-06 15:03:58.064: D/AndroidRuntime(628): Shutting down VM
12-06 15:03:58.064: W/dalvikvm(628): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
12-06 15:03:58.083: E/AndroidRuntime(628): FATAL EXCEPTION: main
12-06 15:03:58.083: E/AndroidRuntime(628): java.lang.ExceptionInInitializerError
12-06 15:03:58.083: E/AndroidRuntime(628): at org.pjsip.pjsua2.app.MainActivity.onCreate(MainActivity.java:85)
12-06 15:03:58.083: E/AndroidRuntime(628): at android.app.Activity.performCreate(Activity.java:4465)
12-06 15:03:58.083: E/AndroidRuntime(628): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
12-06 15:03:58.083: E/AndroidRuntime(628): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
12-06 15:03:58.083: E/AndroidRuntime(628): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
12-06 15:03:58.083: E/AndroidRuntime(628): at android.app.ActivityThread.access$600(ActivityThread.java:123)
12-06 15:03:58.083: E/AndroidRuntime(628): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
12-06 15:03:58.083: E/AndroidRuntime(628): at android.os.Handler.dispatchMessage(Handler.java:99)
12-06 15:03:58.083: E/AndroidRuntime(628): at android.os.Looper.loop(Looper.java:137)
12-06 15:03:58.083: E/AndroidRuntime(628): at android.app.ActivityThread.main(ActivityThread.java:4424)
12-06 15:03:58.083: E/AndroidRuntime(628): at java.lang.reflect.Method.invokeNative(Native Method)
12-06 15:03:58.083: E/AndroidRuntime(628): at java.lang.reflect.Method.invoke(Method.java:511)
12-06 15:03:58.083: E/AndroidRuntime(628): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-06 15:03:58.083: E/AndroidRuntime(628): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-06 15:03:58.083: E/AndroidRuntime(628): at dalvik.system.NativeStart.main(Native Method)
12-06 15:03:58.083: E/AndroidRuntime(628): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1285]: 37 cannot locate 'rand'...
12-06 15:03:58.083: E/AndroidRuntime(628): at java.lang.Runtime.loadLibrary(Runtime.java:370)
12-06 15:03:58.083: E/AndroidRuntime(628): at java.lang.System.loadLibrary(System.java:535)
12-06 15:03:58.083: E/AndroidRuntime(628): at org.pjsip.pjsua2.app.MyApp.<clinit>(MyApp.java:235)
这似乎是申请不能加载libpjsua2.so库。我从来没有使用NDK的过,所以我没有对这个问题的任何想法,请帮助我...
It seems like appl cannot load libpjsua2.so library. I have never used the NDK before, so i don't have any ideas about this issue, please help me...
推荐答案
这会发生,如果你建立你的本机组件与的android-21
目标,但正在努力与较旧的Android版本的设备上运行。除非你采取非常特别的照顾,你不能运行构建与旧设备的的android-21
目标二进制文件。对于基本的C函数,它不应该不管哪个目标之间 Android版本-3
的android-20
您使用,它应该在所有的人,但如果你使用的android-21
它仅适用于该版本和更新。
This happens if you've built your native components with the android-21
target, but are trying to run it on a device with an older Android version. Unless you take very special care, you can't run binaries built with the android-21
target on older devices. For basic C functions, it shouldn't matter which target version between android-3
and android-20
you use, it should work on all of them, but if you use android-21
it only works on that version and newer.
请参阅 http://stackoverflow.com/a/27093163/3115956 有关此问题的更多细节。
See http://stackoverflow.com/a/27093163/3115956 for more details on this issue.
这篇关于无法加载库:reloc_library [1285]:无法找到“兰特”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!