以下课程描述了我使用Jackson 2.2从 .json 文件中读取的模型。
public class Product {
public String name;
public int width;
}
Gradle构建过程调用ProGuard来缩小和混淆发布构建。当我启动应用程序时,会出现以下错误消息:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:
Unrecognized field "name" (class com.example.b.c),
not marked as ignorable (0 known properties: ])
如何配置 ProGuard 或注释Product
类以使 Jackson 仍然有效?