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

Unable to run on Android 7.0 because java.util.Base64 #1044

Open
zpsw opened this issue Nov 22, 2023 · 6 comments
Open

Unable to run on Android 7.0 because java.util.Base64 #1044

zpsw opened this issue Nov 22, 2023 · 6 comments
Labels
needs info Additional info is needed

Comments

@zpsw
Copy link

zpsw commented Nov 22, 2023

Observed behavior

java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/util/Base64;

Expected behavior

can run on Android 7.0

Server and client version

jnats 2.17.1

Host environment

No response

Steps to reproduce

run on Android 7.0

@zpsw zpsw added the defect Suspected defect such as a bug or regression label Nov 22, 2023
@scottf
Copy link
Contributor

scottf commented Nov 22, 2023

@zpsw How does a 4 year old Android version not have part of Java 8? I don't think this is fixable, but I'll welcome any suggestions you might have to fix this.

@scottf scottf added needs info Additional info is needed and removed defect Suspected defect such as a bug or regression labels Nov 22, 2023
@zpsw
Copy link
Author

zpsw commented Nov 23, 2023

Android 7, named Nougat, is a version from 7 years ago. This version indeed lacks java.util.Base64. My current approach is to fork a copy of the code, extract java.util.Base64, and then replace all references. I'm not sure if this is a good solution.
https://stackoverflow.com/questions/55016350/android-nougat-devices-not-supporting-java-util-base64-library
image
image

@scottf
Copy link
Contributor

scottf commented Dec 1, 2023

I suppose we could build an interface for the base46 methods we need and then allow the developer to provide an implementation in connection options. Probably should have some sort of unit test that a developer could run to validate base 64 encoding as a black box.

@scottf
Copy link
Contributor

scottf commented Feb 12, 2024

@zpsw Do you have an implementation that we could possibly put in the code? If you wrote the code that would be the best, if it's a 3rd party library, even OSS, I'd have to consider it carefully.

@scottf
Copy link
Contributor

scottf commented Mar 26, 2024

@zpsw We are currently in discussion to hard fork the repo and port it to api 24. base64 isn't just the only thing in the code that needs to change. I'll try to remember to keep you up to date.

@pwittchen
Copy link

I've added possible solution for this issue in the PR #1120.

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

No branches or pull requests

3 participants