Skip to content

Commit 3257b1d

Browse files
[FSSDK-12682] Fix Jackson serializer NoClassDefFoundError when R8 obfuscates naming strategy fields (#539)
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>
1 parent 92551d2 commit 3257b1d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

proguard-rules.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@
4040
-dontwarn com.fasterxml.jackson.**
4141
-dontwarn org.json.**
4242

43+
# Keep Jackson naming strategy fields accessed via reflection by the Java SDK core-api
44+
# (DefaultJsonSerializer → JacksonSerializer → getSnakeCaseStrategy).
45+
# Without this, R8 obfuscates the field names, causing NoClassDefFoundError at runtime
46+
# when Jackson is on the classpath.
47+
-keepclassmembers class com.fasterxml.jackson.databind.PropertyNamingStrategies {
48+
public static *;
49+
}
50+
-keepclassmembers class com.fasterxml.jackson.databind.PropertyNamingStrategy {
51+
public static *;
52+
}
53+
4354
# Annotations
4455
-dontwarn javax.annotation.**
4556

0 commit comments

Comments
 (0)