Closed carlos-mg89 closed 2 years ago
I don't know how to deal with it. Here are few remarks that may help you:
aar
there is the java code and native libraries packed by platform. On android we use System.loadLibrary that loads the native part directly from inside the aar
. For some reason it fails. Can check that you have the aar in the classpath?I did small Android example https://github.com/luben/ZstdAndroidExample but I have not tried it recently and there is also no tests for it.
One option you can try. Get the jar manually from Maven https://repo1.maven.org/maven2/com/github/luben/zstd-jni/1.5.2-3/zstd-jni-1.5.2-3-linux_amd64.jar , unpack it tell Zstd to use this exactly binary, you have to add -DZstdNativePath=/the/path/to/the/libzstd-jni-1.5.2-3.so
to your java options when running the tests
Well, partly thanks to your help I've been able to deal with the situation.
There was indeed some issues with the zstd-jni library been loaded. However, the solution was simpler than I expected, although I'm unsure about why is that.
When using zstd-jni for your Android app, getting the library at the Gradle file is done as described in the README:
implementation("com.github.luben:zstd-jni:1.5.2-3@aar")
However, for it to work (so to be loaded) while running tests, this should be added as well:
testImplementation("com.github.luben:zstd-jni:1.5.2-3")
Basically, there's some issues that make the library to not be available while loading the AAR.
Perhaps you would like to add this in the documentation.
Aaa, good finding - I will add it to the Android example
Hi!
First of all, I'd like to state that this library is working perfectly fine in my app. I'm able to decompress ZSTD compressed files in a very short time with no issues registered until the moment (it's been already about 2 years since I changed from ZIP compressed files).
However, today I am trying to create some tests for the class I wrote that decompresses InputStreams. And the tests are failing.
From what I understand by reading the error log, the library cannot be found.
I've tried installing it in my Ubuntu (with
apt-get install zstd
, and the output ofzstd --version
iszstd command line interface 64-bits v1.4.8, by Yann Collet
. This clearly doesn't match my Android app's library version, forzstd-jni
which is 1.5.2-3.I guess that Gradle gets the libraries to pack them in the Android app, but it doesn't make them available for the Android test runner.
Does anyone know how to deal with it?
This is the complete error log after running the test on Android Studio: