[FSSDK-12682] Fix Jackson serializer crash caused by R8 obfuscation#539
Merged
muzahidul-opti merged 1 commit intoJul 23, 2026
Merged
Conversation
…uscates naming strategy fields
Add consumer ProGuard rules to preserve Jackson PropertyNamingStrategies
and PropertyNamingStrategy static field names. The core-api's
JacksonSerializer uses reflection (getField("SNAKE_CASE")) to look up
these fields, and R8 obfuscation renames them, crashing the
DefaultJsonSerializer LazyHolder initializer.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@copilot review the pr |
The change looks correct. Here's the review: What the change does: Correctness:
CI: Both |
raju-opti
approved these changes
Jul 23, 2026
muzahidul-opti
deleted the
muzahid/FSSDK-12682-fix-jackson-r8-serializer-crash
branch
July 23, 2026 12:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PropertyNamingStrategiesandPropertyNamingStrategystatic field names from being obfuscated by R8The core-api's
JacksonSerializer.getSnakeCaseStrategy()uses reflection (Class.getField("SNAKE_CASE")) to look up Jackson naming strategy fields. When an app includes Jackson on its classpath and R8 obfuscates those field names, the reflection lookup fails withNoSuchFieldException, which crashes theDefaultJsonSerializer.LazyHolderstatic initializer. All subsequent calls toDefaultJsonSerializer.getInstance()then throwNoClassDefFoundError, preventing any event dispatch (impressions and conversions).Since
proguard-rules.txtis already configured asconsumerProguardFiles, these rules are automatically merged into any app that depends on the SDK — no manual ProGuard configuration required by customers.Both
PropertyNamingStrategies(Jackson 2.12+) andPropertyNamingStrategy(Jackson 2.11 and earlier) are covered, matching the two-tier reflection fallback inJacksonSerializer.Test plan
DefaultJsonSerializerinitializes withoutNoClassDefFoundErrorIssues