当使用greenDao时,出现不能生成DaoSession、XXXXDao,运行项目报错
Found 2 problem(s) parsing "D:\study\imooc_music_app-master\GreenDaoDemo\app\src\main\java\com\sjfy\greendaodemo\PhoneBean.java":
1 @1: Pb(324) The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files (ID: 16777540; error: true)
2 @10: Pb(140) Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor (ID: 134217868; error: true)
说明greenDao需要的jdk版本与当前使用jdk版本不一致.相关链接:https://github.com/greenrobot/greenDAO/issues/1018
解决方案:
1.升级greenDao到支持当前使用的jdk版本。
2.修改当前jdk版本。
greenDao版本升级日志:https://greenrobot.org/greendao/changelog/