Java.lang.unsatisfiedlinkerror: Dlopen Failed: Could Not Load Library "libcrypto.so.1.0.0" Needed By "libprivatessl.so";
I am using prebuilt openssl in my project.after loading app is crashing and giving this error java.lang.UnsatisfiedLinkError: dlopen failed: could not load library 'libcrypto.so.1.
Solution 1:
You downloaded some wrong version of OpenSSL for Android, which was not built correctly (similar to this one. Android does not support versioning in SONAMEs.
You can find a better prebuilt version of OpenSSL, but this is not recommended. For these libraries to be entrusted with your secret communications, you should better make sure that you yourself build it from a trusted (official) source, and it does not leak your private information to some rogue third party.
As a minimal fix, you can try to use the patchelf utility to fix the SONAME in your library.
Solution 2:
i solved this issue by making some little changes in android.mk file
i removed .so files and placed .a files.
my android.mk looks like this now
LOCAL_PATH := $(call my-dir)include$(CLEAR_VARS)
LOCAL_MODULE := ssl_static
LOCAL_SRC_FILES := precompiled/libssl.a
include$(PREBUILT_STATIC_LIBRARY)include$(CLEAR_VARS)
LOCAL_MODULE := crypto_static
LOCAL_SRC_FILES :=precompiled/libcrypto.a
include$(PREBUILT_STATIC_LIBRARY)include$(CLEAR_VARS)
LOCAL_MODULE := myLibrary
LOCAL_SRC_FILES := native-lib.cpp
LOCAL_C_INCLUDES = $(LOCAL_PATH)/include
LOCAL_LDLIBS := -llog
LOCAL_STATIC_LIBRARIES := ssl_static crypto_static
include$(BUILD_SHARED_LIBRARY)
got this idea from here
Post a Comment for "Java.lang.unsatisfiedlinkerror: Dlopen Failed: Could Not Load Library "libcrypto.so.1.0.0" Needed By "libprivatessl.so";"