GreenDao定义@Entity编译出错

GreenDao配置gradle都没问题,但是定义实体类添加@Entity的时候编译总会报

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)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:greendao'.
> Found 2 problem(s) parsing "D:\study\imooc_music_app-master\GreenDaoDemo\app\src\main\java\com\sjfy\greendaodemo\PhoneBean.java". First problem:
  Pb(324) The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files (16777540 at line 1).
  Run gradle with --info for more details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

找了几个小时才发现是jdk不匹配的问题,
如下图打上勾即可:
GreenDao定义@Entity编译出错_第1张图片

你可能感兴趣的:(GreenDao定义@Entity编译出错)