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

java.lang.NoClassDefFoundError: com.fasterxml.jackson.databind.ser.impl.ReadOnlyClassToSerializerMap$$ExternalSyntheticLambda0 #3657

Closed
zero0cool0 opened this issue Nov 10, 2022 · 2 comments
Labels
to-evaluate Issue that has been received but not yet evaluated

Comments

@zero0cool0
Copy link

zero0cool0 commented Nov 10, 2022

Describe the bug

The following snippet

        ObjectMapper mapper = new ObjectMapper();
        ArrayList<Integer> list = new ArrayList<>();
        list.add(1);
        try {
            String s = mapper.writeValueAsString(list);
        } catch (JsonProcessingException e) {
            Timber.e(e);
        }

crashes with

java.lang.NoClassDefFoundError: com.fasterxml.jackson.databind.ser.impl.ReadOnlyClassToSerializerMap$$ExternalSyntheticLambda0

The same snippet is working under 2.13.3 but is now failing with 2.14.0

Version information
2.14.0, gradle compileSdkVersion 33, minSdkVersion 22
Error only happens on Android API 23 or lower

Additional Information
The single gradle line relating to this is

implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version"

where jackson_version is set to 2.14.0

Gradle dependency tree is as follows:

+--- com.fasterxml.jackson.core:jackson-databind:2.14.0
|    +--- com.fasterxml.jackson.core:jackson-annotations:2.14.0
|    |    \--- com.fasterxml.jackson:jackson-bom:2.14.0
|    |         +--- com.fasterxml.jackson.core:jackson-annotations:2.14.0 (c)
|    |         +--- com.fasterxml.jackson.core:jackson-core:2.14.0 (c)
|    |         \--- com.fasterxml.jackson.core:jackson-databind:2.14.0 (c)
|    +--- com.fasterxml.jackson.core:jackson-core:2.14.0
|    |    \--- com.fasterxml.jackson:jackson-bom:2.14.0 (*)
|    \--- com.fasterxml.jackson:jackson-bom:2.14.0 (*)
@zero0cool0 zero0cool0 added the to-evaluate Issue that has been received but not yet evaluated label Nov 10, 2022
@zero0cool0 zero0cool0 reopened this Nov 11, 2022
@cowtowncoder
Copy link
Member

While I do not know exactly how this specific error comes about, Jackson 2.14 will require Android SDK 26, due to #3658.
Perhaps that is the root cause.

I updated 2.14 release notes to mention this baseline increase:

https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.14

If earlier Android SDK support is needed, 2.13.x needs to be used; that branch remains open.

@zero0cool0
Copy link
Author

Thank you. Reverting back to 2.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to-evaluate Issue that has been received but not yet evaluated
Projects
None yet
Development

No branches or pull requests

2 participants