1

I use in project the crypto++ library. It works fine. When I try to add 64bit version I got the error:

   Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "D:/AndroidStudioProjects/Proj/app/src/main/obj/local/arm64-v8a/libcryptopp.so" not found
W/System.err:     at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
W/System.err:     at java.lang.System.loadLibrary(System.java:1657)

To use 64bit version cryptopp I built this one for arm64-v8a arch. Then I run ndk-build with make-files: Android.mk:

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := cryptopp
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libcryptopp.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
include $(PREBUILT_SHARED_LIBRARY)

Application.mk:

APP_ABI := arm64-v8a
APP_CPPFLAGS += -fexceptions -frtti
APP_STL := stlport_shared

After I run app on device. I had error above. Why the system search library in wrong path "D:/AndroidStudioProjects/Proj/app/src/main/obj/local/arm64-v8a/libcryptopp.so"? It is path from my computer.

shizhen
  • 12,251
  • 9
  • 52
  • 88
  • You have me stumped. Maybe it is a 32-bit version of Java trying to load a 64-bit version of the library. If/when you find out I'll add it to [Android Activity](https://www.cryptopp.com/wiki/Android_Activity), [Android (Command Line)](https://www.cryptopp.com/wiki/Android_(Command_Line)) and [Android.mk (Command Line)](https://www.cryptopp.com/wiki/Android.mk_(Command_Line)) on the wiki. – jww Jan 04 '19 at 22:38
  • Maybe @Dan is right... `arm64-v8a` looks unusual, it is usually `armv8-a` or `arm64`. A few questions ... What is the value of `TARGET_ARCH_ABI`? Where is `libcryptopp.so` in your tree? Does `D:/AndroidStudioProjects/Proj/app/src/main/obj/local/arm64-v8a/` exist? – jww Jan 08 '19 at 05:58
  • Only now I can go back to this issue. I checked, @DanAlbert is right. – sittingInFront Mar 19 '19 at 07:47

0 Answers0