目前我正在使用BRIDj-0.6.1-android.jar for Android。问题是库显示未满足的链接错误,如下所示:
09-27 17:51:58.740: E/AndroidRuntime(12589): Caused by: java.lang.ExceptionInInitializerError
09-27 17:51:58.740: E/AndroidRuntime(12589): at java.lang.Class.newInstanceImpl(Native Method)
09-27 17:51:58.740: E/AndroidRuntime(12589): at java.lang.Class.newInstance(Class.java:1472)
09-27 17:51:58.740: E/AndroidRuntime(12589): at org.bridj.BridJ.getRuntimeByRuntimeClass(BridJ.java:233)
09-27 17:51:58.740: E/AndroidRuntime(12589): at org.bridj.BridJ.getRuntime(BridJ.java:264)
09-27 17:51:58.740: E/AndroidRuntime(12589): at org.bridj.BridJ.register(BridJ.java:287)
09-27 17:51:58.740: E/AndroidRuntime(12589): at org.bridj.BridJ.register(BridJ.java:161)
09-27 17:51:58.740: E/AndroidRuntime(12589): at com.g5.jna.crypto.LibcryptoLibrary.<clinit>(LibcryptoLibrary.java:20)
09-27 17:51:58.740: E/AndroidRuntime(12589): ... 6 more
09-27 17:51:58.740: E/AndroidRuntime(12589): Caused by: java.lang.ExceptionInInitializerError
09-27 17:51:58.740: E/AndroidRuntime(12589): at org.bridj.CRuntime.<clinit>(CRuntime.java:450)
09-27 17:51:58.740: E/AndroidRuntime(12589): ... 13 more
09-27 17:51:58.740: E/AndroidRuntime(12589): Caused by: java.lang.UnsatisfiedLinkError: sizeOf_ptrdiff_t
09-27 17:51:58.740: E/AndroidRuntime(12589): at org.bridj.Platform.sizeOf_ptrdiff_t(Native Method)
09-27 17:51:58.740: E/AndroidRuntime(12589): at org.bridj.Platform.<clinit>(Platform.java:149)
我已经将 libcrypto.so 文件保存在我的Android项目的lib/armeabi/路径中。
我该如何解决这个问题?
有一个关于此的开放问题:https://github.com/ochafik/nativelibs4java/issues/335