GreenDao实体类实现Serializable接口报错

错误如下:

Error:Execution failed for task ‘:app:greendao’.

Found 1 problem(s) parsing “/Users/davidinchina/Documents/gitWork/

EnglishStu/app/src/main/java/bdkj/com/englishstu/common/beans/

Admin.java”. First problem:

Pb(96) The serializable class Admin does not declare a static final

serialVersionUID field of type long (536871008 at line 17).

Run gradle with –info for more details.

解决方式:
在类中添加如下语句:

static final long serialVersionUID = 42L;

答案来自:

https://github.com/greenrobot/greenDAO/issues/494

你可能感兴趣的:(Android编程)