Warning: libcryptopp.so: missing. DT_SONAME will use the base name as a replacement

I am trying to build libcryptopp.so and include it in my JNI code, following the guide in Android Crypto ++ , I experienced the following problems.

Missing character issues in Crypto ++ 5.6.3

I originally used Crypto ++ 5.6.3, I ran into this problem:

  java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_Z9GlobalRNGv" referenced by "/data/app/com.example.administrator.jnitest-2/lib/arm/libcryptopp.so"... 

I check libcryptopp.so :

 $ readelf -Ws libcryptopp.so | grep _Z9GlobalRNGv 1406: 00000000 0 NOTYPE GLOBAL DEFAULT UND _Z9GlobalRNGv 15836: 00000000 0 NOTYPE GLOBAL DEFAULT UND _Z9GlobalRNGv 

switching to Crypto ++ 5.6.4 fix this problem, but I still don’t know the reason and ran into another problem:

Missing DT_SONAME

 12-21 09:50:20.837 21677-21677/com.example.administrator.jnitest W/linker: /data/app/com.example.administrator.jnitest- 1/lib/arm/libcryptopp.so: is missing DT_SONAME will use basename as a replacement: "libcryptopp.so" 

This is actually just a warning , the application will not crash.

I am using the latest version of android Mashwallow MOB31K. Someone also had similar problems using other libraries.

 https://github.com/bytedeco/javacpp-presets/issues/188 

on Android N-preview.

Why am I getting a warning and how to fix it?

+5
source share
1 answer

After some attempts, I find one imperfect solution.

It looks like the Android queue requires a library version.

enable the SONAME flag in the assembly.

Cryptopp disables the default version flag. In GNUmakefile-cross:

 HAS_SOLIB_VERSION ?= 0 

set the value to 1:

 HAS_SOLIB_VERSION ?= 1 

build, and then use the generated .so file. warning will come.

The problem is that the library will not work on Android 5.0. Therefore, we better leave this warning now.

+2
source

Source: https://habr.com/ru/post/1261619/


All Articles