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

NoClassDefFoundError on StandardCharsets for API 18 and below #129

Closed
adelpuva opened this issue May 10, 2016 · 5 comments
Closed

NoClassDefFoundError on StandardCharsets for API 18 and below #129

adelpuva opened this issue May 10, 2016 · 5 comments
Labels
bug Something isn't working

Comments

@adelpuva
Copy link

Hi!
The documentation says that AWS SDK supports Android API 10+, but two classes (https://github.com/aws/aws-sdk-android/search?utf8=✓&q=StandardCharsets) uses StandardCharset that is only available from 19 (http://developer.android.com/reference/java/nio/charset/StandardCharsets.html)

@danielesegato
Copy link

This:
StandardCharsets.UTF_8
should be replaced with:
Charset.forName("UTF-8")

danielesegato pushed a commit to danielesegato/aws-sdk-android that referenced this issue May 10, 2016
StandardCharsets has been added in Java 1.7 and Android SDK 19 and thus
cause a java.lang.NoClassDefFoundError in Android 18 and below.

Should resolve issue aws-amplify#129
@adelpuva adelpuva changed the title java.nio.charset.StandardCharset NoClassDefFoundError on StandardCharsets for API 18 and below May 10, 2016
@fosterzhang fosterzhang added the bug Something isn't working label May 10, 2016
@fosterzhang
Copy link
Contributor

@adelpuva Thanks for reporting this. We are aware of this issue and have a fix for it (as pointed out by @danielesegato). Stay tuned for the next release.

@fosterzhang
Copy link
Contributor

@adelpuva This is fixed in v2.2.16. For detailed changes, please refer to the change log.

@adelpuva
Copy link
Author

Thank you!

@adelpuva
Copy link
Author

adelpuva commented Aug 18, 2016

In the last SDK (2.3.0) is also used StandardCharsets class in CognitoUser.java:

srpAuthResponses.put("PASSWORD_CLAIM_SIGNATURE", new String(Base64.encode(hmac), StandardCharsets.UTF_8));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants