-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
JsonMappingException in release build with ProGuard #2290
Comments
Explaining the problemThe actual source problem of this issue is not Jackson. The code and resource shrinker in the Android build removes resources not directly referenced in code. This is the case for files in my project located in the > Task :Umweltzone:transformClassesAndDexWithShrinkResForRelease
Removed unused resources: Binary resource data reduced from 1549KB to 1100KB: Removed 28 Also the error message in the stacktrace kind of tells about it .. com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input
at [Source: android.content.res.AssetManager$AssetInputStream@78c8e0; line: 1, column: 0] Another valuable tool to get insights is the APK analyzer of Android Studio which revealed that the shrinked down files were still present in the One solutionTo prevent the shrinking Google recommends to explicitly tell the build task to keep the files. Therefore, I have to put a RelatedAll the above findings have been discovered by @cketti. Big thanks for your help! 👍 |
+ Zones files in raw/lez_* are no longer directly referenced in code since this commit. Therefore, the code shrinker needs to explicitly be instructed to skip these files in a RELEASE build. See: FasterXML/jackson-databind#2290 Thanks to @cketti for helping to resolve this challenge.
+ Zones files in raw/lez_* are no longer directly referenced in code since this commit. Therefore, the code shrinker needs to explicitly be instructed to skip these files in a RELEASE build. See: FasterXML/jackson-databind#2290 Thanks to @cketti for helping to resolve this challenge.
+ Zones files in raw/lez_* are no longer directly referenced in code since this commit. Therefore, the code shrinker needs to explicitly be instructed to skip these files in a RELEASE build. See: FasterXML/jackson-databind#2290 Thanks to @cketti for helping to resolve this challenge.
I am stuck with a
JsonMappingException
which occurs when I compile aRELEASE
with ProGuard obfuscation enabled and run this Android app. It does not occur when I compile and run aDEBUG
build.I was able to narrow the issue down to this commit where I introduce
getFileName()
in theChildZone
interface being reflected on the concreteLowEmissionZone
class.Due to the exception in
ContentProvider.getContent:128
the list of circuits inContentProvider.getCircuits():92
becomes and empty array.The current ProGuard setting can be found here.
Here is the stacktrace which I deobfuscated from the
RELEASE
build.Environment
com.fasterxml.jackson.core:jackson-databind:2.8.10
, Cannot update at the moment.net.sf.proguard:proguard-gradle:6.0.3
Related
The text was updated successfully, but these errors were encountered: