Android: couldn't find "libdashjbls.so"
Closed this issue · 3 comments
Hi.
I try to generate BLS key on android device, but I always get the error when I trying to create bytes for BLSSecretKey:
val bytes = ByteArray(BLSSecretKey.BLS_CURVE_SECKEY_SIZE)
I used next step to init dashj:
git submodule update --init --recursive
mvn clean package -DskipTests
mvn clean install
and I got :
java.lang.RuntimeException: dalvik.system.PathClassLoader[DexPathList[[ zip file "/data/app/some_package-1/base.apk", zip file "/data/app/some_package-1/split_lib_dependencies_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_0_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_1_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_2_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_3_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_4_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_5_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_6_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_7_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_8_apk.apk", zip file "/data/app/some_package-1/split_lib_slice_9_apk.apk"], nativeLibraryDirectories=[/data/app/some_package-1/lib/arm64, /system/lib64, /vendor/lib64]]] couldn't find "libdashjbls.so" at org.bitcoinj.crypto.BLSAbstractObject.<clinit>(BLSAbstractObject.java:21)
Building dashj does not include the dashjbls library in the jar. Even if it did, it wouldn't be useful since it would only support one architecture and perhaps none used by android.
Check out this link:
https://github.com/HashEngineering/dash-wallet/tree/master/wallet/cpp/dashj-bls
The above folder contains other files needed to build libdashjbls.so on android.
this has the code to build libdashjbls.so and include it for 4 architectures on android.
https://github.com/HashEngineering/dash-wallet/blob/master/wallet/build.gradle#L95
Ok, thank you.
I tried to compile the lib, but when I tried it, I always got
In file included from /home/user/repo/some_package/app/dashj-bls/bls-signatures/src/extendedpublickey.cpp:16: /home/user/repo/some_package/app/dashj-bls/bls-signatures/src/extendedpublickey.hpp:18:10: fatal error: 'relic_conf.h' file not found #include "relic_conf.h"
What I do wrong?
Did you run this command in your app repo?
git submodule update --init --recursive
dashj requires bls-signatures
which requires relic
and the app will require the same.
Do you have your code on a GitHub repo that I can look at?