Closed varunagarwal315 closed 1 year ago
Native JNI functions are bound to a package (in this case za.co.twyst.tweetnacl) when the native library is compiled, so you can't move the Java class to a different package without updating the 'C' implementation and recompiling the library. Ditto with changing a function to static - you need to update the JNI signature.
Suggestion: put the TweetNaCl java class back into it's original package and get it working like that. Once you have a working reference implementation you can make a version of the native lib with your own package name (if you feel strongly about it :-))
@varunagarwal315 did you figure it out? I am trying to port tweetnacl for android.
Closing - no response and no activity
I have coped the code from native-lib , the TweetNacl code and the exceptions as well. The gradle syncs well. Now If I try to call the functions in another activity, I get this error
First issue is that to use cryptoBoxKeyPair(), the function in the TweetNacl.java file had to be made
static
. Now If I run this I get an error that points to this line and throws the exceptionjava.lang.UnsatisfiedLinkError
.If I comment out this line this error comes
java.lang.UnsatisfiedLinkError: No implementation found for int com.example.varun.vesica.encryption.TweetNaCl.jniCryptoBoxKeyPair(byte[]
In Usage section of the ReadMe.md I am following this line
Alternatively, copy the libs and src directories to your own project.
but not able to do it. Could someone tell me how to tackle these errors. Thanks