v5.8.0 added default values in these constructor parameters, which compiled to bytecode results in two constructors. This results in Moshi generating a slightly different JsonAdapter class, which needs to use the DEFAULT_CONSTRUCTOR_MARKER field to try and find the correct ctor.
If a user has a plugin in the buildscript classpath which has a dependency on an old version of Moshi (<1.9.1) then the DEFAULT_CONSTRUCTOR_MARKER is not present, resulting in a NoSuchFieldError being thrown.
This fixes the issue by avoiding the use of default parameters. The end-user should also update any plugins using an old version of Moshi.
Goal
v5.8.0 added default values in these constructor parameters, which compiled to bytecode results in two constructors. This results in Moshi generating a slightly different JsonAdapter class, which needs to use the
DEFAULT_CONSTRUCTOR_MARKER
field to try and find the correct ctor.If a user has a plugin in the buildscript classpath which has a dependency on an old version of Moshi (<1.9.1) then the
DEFAULT_CONSTRUCTOR_MARKER
is not present, resulting in aNoSuchFieldError
being thrown.This fixes the issue by avoiding the use of default parameters. The end-user should also update any plugins using an old version of Moshi.
Testing
Manually verified in an example app.