fusionauth-jwt icon indicating copy to clipboard operation
fusionauth-jwt copied to clipboard

Android 7 - Base64 NoClassDefFoundError

Open TobiasReich opened this issue 2 years ago • 1 comments

I guess that is an issue with the Java version not being as modern as it should but when I try to use it in my Android App (for Android 7, API Level 24) the app crashes.

The call:

JWT.getDecoder().decode(token, verifier)

is trying the to execute the following line:

Header header = Mapper.deserialize(base64Decode(parts[0]), Header.class);

Which fails because the base64 decoder is not fund. On newer Android Versions this works so I assume the library is just not compatible. Any specifications regarding that? I couldn't find anything. Or am I just doing it wrong?

TobiasReich avatar Jan 18 '22 16:01 TobiasReich

Just had a look, the Base64 class is available from Android API 26

https://developer.android.com/reference/java/util/Base64

maybe it might come handy to state this in the info so others like me can see it quickly.

Thanks!

TobiasReich avatar Jan 19 '22 11:01 TobiasReich