Open aagam-chai opened 1 year ago
Hi @aagam-chai,
I think all you need to do to the consuming project is add JNA to it...
implementation "net.java.dev.jna:jna:5.13.0@aar"
Hi @gurpreet-
I have same issue.
My SDK uses
api "com.goterl:lazysodium-android:5.1.0@aar"
implementation "net.java.dev.jna:jna:5.13.0@aar"
Then in consumer app when : 1)
implementation project(path: ":my-sdk")
it WORKS
2)
implementation 'com.example.org:my-sdk:version'
Runtime exception
FATAL EXCEPTION: main
Process: com.example.myapplication, PID: 10753
java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/android-aarch64/libjnidispatch.so) not found in resource path (.)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1059)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1015)
at com.sun.jna.Native.<clinit>(Native.java:221)
at com.sun.jna.Native.register(Native.java:1773)
at com.goterl.lazysodium.SodiumAndroid.<init>(SodiumAndroid.java:36)
at com.goterl.lazysodium.SodiumAndroid.<init>(SodiumAndroid.java:17)
3)
implementation 'com.example.org:my-sdk:version'
implementation "net.java.dev.jna:jna:5.13.0@aar"
Compile exception
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Any suggestions?
I see this as well in my project. I've added the jna library as a dependency but it still doesn't work for some reason.
Already open I have the same issue with
api "com.goterl:lazysodium-android:5.1.0@aar"
implementation "net.java.dev.jna:jna:5.13.0@aar"
jna = "5.13.0" kotlin = "2.0.20"
Native library (com/sun/jna/android-aarch64/libjnidispatch.so) not found in resource path (.)
As I was creating an Android library, encryption was necessary, therefore I added lazysodium to it.
When I tested my library module during development, it was successful. However, after it was published on github and hosted on jitpack, I called the same function from the SDK, which contains the encryption code, and it consistently produced this problem.
The suspected issue is with the '@aar' thing, is there anything special required to have this dependency in a library module?