terl / lazysodium-android

An Android implementation of the Libsodium cryptography library. For the lazy dev.
https://github.com/terl/lazysodium-java/wiki
Mozilla Public License 2.0
108 stars 25 forks source link

Getting UnsatisfiedLinkError when I try to init lazySodium #37

Closed KarimFikani closed 4 years ago

KarimFikani commented 4 years ago

Hi,

I'm getting the following exception when I initialize lazySodium in release mode (works fine in debug):

try {
    lazySodium = LazySodiumAndroid(SodiumAndroid())
} catch (e: UnsatisfiedLinkError) {
    Log.e(TAG, "Failed to init lazySodium", e)
    return
}
java.lang.UnsatisfiedLinkError: Can't obtain peer field ID for class com.sun.jna.Pointer
        at com.sun.jna.Native.initIDs(Native Method)
        at com.sun.jna.Native.<clinit>(SourceFile:23)
        at com.sun.jna.Native.H(SourceFile:1)
        at com.goterl.lazycode.lazysodium.c.<init>(SourceFile:4)
        at com.goterl.lazycode.lazysodium.c.<init>(SourceFile:1)

Not sure what could be the problem here.

KarimFikani commented 4 years ago

add this https://docs.lazycode.co/lazysodium/usage/installation#proguard

dmerillat commented 3 years ago

That URL is now defunct.