解决greendao编译失败 Please either mark it with @Keep annotation instead of @Generate

1,346 阅读1分钟

image.png

Execution failed for task ':middle_component:greendao'.

Constructor (see UserProfile:64) has been changed after generation. Please either mark it with @Keep annotation instead of @Generated to keep it untouched, or use @Generated (without hash) to allow to replace it.

参考了几篇文章,解决方案都无效:

blog.csdn.net/weixin_3607…

chchaooo.github.io/2018/02/26/…

构建前的构造方法如下图:

image.png

删除hash数字,如下图所示,然后重新构建即可

image.png