Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when calling new LazySodiumAndroid(new SodiumAndroid()); #9

Closed
susanp opened this issue Jul 9, 2018 · 4 comments · Fixed by #28
Closed

Crash when calling new LazySodiumAndroid(new SodiumAndroid()); #9

susanp opened this issue Jul 9, 2018 · 4 comments · Fixed by #28
Assignees
Labels
documentation This is mainly a documentation issue resolved When the issue or problem was resolved successfully stuck You're stuck on some part of Lazysodium, be it a bug or an unexpected outcome or the documentation

Comments

@susanp
Copy link

susanp commented Jul 9, 2018

When I try to use your library I get the following error when running my Android app:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/sun/jna/Native; at com.goterl.lazycode.lazysodium.SodiumAndroid.<init>(SodiumAndroid.java:37) at com.goterl.lazycode.lazysodium.SodiumAndroid.<init>(SodiumAndroid.java:17)

Any idea on how to fix this? It compiles without problems, but on runtime it crashes when calling LazySodiumAndroid lazySodium = new LazySodiumAndroid(new SodiumAndroid());.

@gurpreet-
Copy link
Contributor

Hello @susanp.

Whoops! I seem to have forgotten to add instructions to include JNA as a dependency in the docs. Totally my bad.

I think adding this line to the dependencies will resolve your error:

dependencies {
    implementation "com.goterl.lazycode:lazysodium-android:VERSION_NUMBER@aar"
    implementation 'net.java.dev.jna:jna:4.5.1@aar' // Add this line
}

Let me know if that works for you. I'll add the missing JNA dependency instructions to the readme and docs soon. Thanks.

@gurpreet- gurpreet- self-assigned this Jul 9, 2018
@gurpreet- gurpreet- added stuck You're stuck on some part of Lazysodium, be it a bug or an unexpected outcome or the documentation documentation This is mainly a documentation issue labels Jul 9, 2018
@susanp
Copy link
Author

susanp commented Jul 9, 2018

Thanks, works! 👍
Thought it might be something like that

@gurpreet- gurpreet- added the resolved When the issue or problem was resolved successfully label Jul 9, 2018
@gurpreet-
Copy link
Contributor

Added to docs and the readme. Thanks for the report!

@karan4c6
Copy link

I have also faced the same issue and I could find fix over here only after googling.
The fix is still not in the documentation or Readme file:
implementation 'net.java.dev.jna:jna:4.5.1@aar' // Add this line

Kindly add it to readme.
Thanks

mitfik added a commit to mitfik/lazysodium-android that referenced this issue Sep 17, 2019
Fix terl#9 missing JNA implementation in instruction
gurpreet- pushed a commit that referenced this issue Sep 19, 2019
Fix #9 missing JNA implementation in instruction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is mainly a documentation issue resolved When the issue or problem was resolved successfully stuck You're stuck on some part of Lazysodium, be it a bug or an unexpected outcome or the documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants