GreenDao 添加新字段报错
Error:Execution failed for task ':app:greendao'.
> Constructor (see UserInfo:61) 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.
解决:
- 去掉@Generated 注解后面的一串数字(重新编译会自动生成)
- 然后 从新编译
- 编译完之后,如果报以下错误,找不到字段
E/SQLiteLog: (1) table USER_INFO has no column named XM
- 新加字段一般需要重新导入数据库