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 on API < 26 #24

Open
hivian opened this issue Apr 29, 2019 · 5 comments
Open

Crash on API < 26 #24

hivian opened this issue Apr 29, 2019 · 5 comments
Assignees

Comments

@hivian
Copy link

hivian commented Apr 29, 2019

Hi,

I have a runtime crash on devices with API < 26

java.lang.NoClassDefFoundError: Failed resolution of: Ljava/util/Base64;
        at com.amdelamar.jhash.util.HashUtils.encodeBase64(HashUtils.java:103)
        at com.amdelamar.jhash.Hash.create(Hash.java:182)

This class seems to be not available on older devices.

@amdelamar amdelamar self-assigned this Apr 29, 2019
@amdelamar
Copy link
Owner

Are you running Java 8 or newer?

@amdelamar
Copy link
Owner

I assume you meant Android when you say "API < 26". Unfortunately, this lib is not tested on Android.

Looks like java.util.Base64 is not part of Android SDK. As mentioned by this SO question.

@hivian
Copy link
Author

hivian commented May 3, 2019

Yes I noticed your library was a java project and can't use android.util.Base64. I will find another way.

Thanks

@ThanosFisherman
Copy link

I am also in search of a hashing library that supports android api 21 and above. As a last resort I'm going to try Bouncy Castle. So far I've been trying to avoid it because it's too bloated but it should work fine nevertheless.

Here is the Android crypto compatibility doc
https://developer.android.com/reference/javax/crypto/SecretKeyFactory

@mc51
Copy link

mc51 commented Dec 10, 2020

For me it works great on Android. Thanks @amdelamar for this great lib.
To make it work, I have set minSdkVersion 26 and added the following to my build.gradle (app):

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants