Moshi抛出启用了缩小功能的异常“无法创建转换器”

问题描述

moshi抛出此异常:

Unable to create converter for com.xxxx.app.xxxx.xxxx.main.moshi.SingleData<ActorEntity>

但仅在调试 环境中!

版本中,环境正常运行。

那怎么可能?

仅供参考:我目前正在将我的moshi从1.3版更新到1.9.3版!

解决方法

我发现了我的问题,这是因为我必须设置:

buildTypes {
    debug {
        minifyEnabled true // <----- That was missing
    }

    release {
        minifyEnabled true
    }
}

我是Android的新手,所以我不知道ProGuard是什么,但是您可以阅读更多内容:herherher