Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object org.greenrobot.greendao.database.Database.getRawDatabase()' on a null object reference #995

Open
chenyunecjtu opened this issue Sep 20, 2019 · 4 comments

Comments

@chenyunecjtu
Copy link

No description provided.

@chenyunecjtu
Copy link
Author

chenyunecjtu commented Sep 20, 2019

9009-16 15:42:12.915 21870 21870 D AndroidRuntime: Shutting down VM
91--------- beginning of crash
9209-16 15:42:12.927 21870 21870 E AndroidRuntime: FATAL EXCEPTION: main
9309-16 15:42:12.927 21870 21870 E AndroidRuntime: Process: com.yuwan.zbshipin, PID: 21870
9409-16 15:42:12.927 21870 21870 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yuwan.zbshipin/com.yuwan.meet.activity.P2PChatActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object org.greenrobot.greendao.database.Database.getRawDatabase()' on a null object reference
9509-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3430)
9609-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
9709-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
9809-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
9909-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
10009-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
10109-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:112)
10209-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.os.Looper.loop(Looper.java:216)
10309-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7625)
10409-16 15:42:12.927 21870 21870 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
10509-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
10609-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
10709-16 15:42:12.927 21870 21870 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object org.greenrobot.greendao.database.Database.getRawDatabase()' on a null object reference
10809-16 15:42:12.927 21870 21870 E AndroidRuntime: at org.greenrobot.greendao.AbstractDao.<init>(SourceFile:85)
10909-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.app.model.dao.bean.ChatUserDMDao.<init>(SourceFile:40)
11009-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.app.model.dao.bean.DaoSession.<init>(SourceFile:49)
11109-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.app.model.dao.bean.DaoMaster.newSession(SourceFile:58)
11209-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.app.model.dao.DaoManager.getDaoSession(SourceFile:67)
11309-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.app.model.dao.bean.ChatMsgDM.dao(SourceFile:429)
11409-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.app.greendaoadapter.d.findBy(SourceFile:157)
11509-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.app.greendaoadapter.d.findAll(SourceFile:177)
11609-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.app.model.dao.bean.ChatMsgDM.getGroupMessages(SourceFile:761)
11709-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.app.model.dao.bean.ChatMsgDM.getUserMessages(SourceFile:790)
11809-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.yuwan.meet.e.av.a(SourceFile:121)
11909-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.yuwan.meet.activity.P2PChatActivity.onCreateContent(SourceFile:195)
12009-16 15:42:12.927 21870 21870 E AndroidRuntime: at com.app.activity.CoreActivity.onCreate(SourceFile:160)
12109-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:7458)
12209-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:7448)
12309-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286)
12409-16 15:42:12.927 21870 21870 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409)
12509-16 15:42:12.927 21870 21870 E AndroidRuntime: ... 11 more
12609-16 15:42:12.927 21870 21870 D MtaSDK : [main(1): null:56] - MTA has caught the following uncaught exception:
12709-16 15:42:12.927 21870 21870 E MtaSDK :
12809-16 15:42:12.927 21870 21870 E MtaSDK : java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yuwan.zbshipin/com.yuwan.meet.activity.P2PChatActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object org.greenrobot.greendao.database.Database.getRawDatabase()' on a null object reference
12909-16 15:42:12.927 21870 21870 E MtaSDK : at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3430)
13009-16 15:42:12.927 21870 21870 E MtaSDK : at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
13109-16 15:42:12.927 21870 21870 E MtaSDK : at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
13209-16 15:42:12.927 21870 21870 E MtaSDK : at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
13309-16 15:42:12.927 21870 21870 E MtaSDK : at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
13409-16 15:42:12.927 21870 21870 E MtaSDK : at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
13509-16 15:42:12.927 21870 21870 E MtaSDK : at android.os.Handler.dispatchMessage(Handler.java:112)
13609-16 15:42:12.927 21870 21870 E MtaSDK : at android.os.Looper.loop(Looper.java:216)
13709-16 15:42:12.927 21870 21870 E MtaSDK : at android.app.ActivityThread.main(ActivityThread.java:7625)
13809-16 15:42:12.927 21870 21870 E MtaSDK : at java.lang.reflect.Method.invoke(Native Method)
13909-16 15:42:12.927 21870 21870 E MtaSDK : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
14009-16 15:42:12.927 21870 21870 E MtaSDK : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
14109-16 15:42:12.927 21870 21870 E MtaSDK : Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object org.greenrobot.greendao.database.Database.getRawDatabase()' on a null object reference
14209-16 15:42:12.927 21870 21870 E MtaSDK : at org.greenrobot.greendao.AbstractDao.<init>(SourceFile:85)
14309-16 15:42:12.927 21870 21870 E MtaSDK : at com.app.model.dao.bean.ChatUserDMDao.<init>(SourceFile:40)
14409-16 15:42:12.927 21870 21870 E MtaSDK : at com.app.model.dao.bean.DaoSession.<init>(SourceFile:49)
14509-16 15:42:12.927 21870 21870 E MtaSDK : at com.app.model.dao.bean.DaoMaster.newSession(SourceFile:58)
14609-16 15:42:12.927 21870 21870 E MtaSDK : at com.app.model.dao.DaoManager.getDaoSession(SourceFile:67)
14709-16 15:42:12.927 21870 21870 E MtaSDK : at com.app.model.dao.bean.ChatMsgDM.dao(SourceFile:429)
14809-16 15:42:12.927 21870 21870 E MtaSDK : at com.app.greendaoadapter.d.findBy(SourceFile:157)
14909-16 15:42:12.927 21870 21870 E MtaSDK : at com.app.greendaoadapter.d.findAll(SourceFile:177)
15009-16 15:42:12.927 21870 21870 E MtaSDK : at com.app.model.dao.bean.ChatMsgDM.getGroupMessages(SourceFile:761)
15109-16 15:42:12.927 21870 21870 E MtaSDK : at com.app.model.dao.bean.ChatMsgDM.getUserMessages(SourceFile:790)
15209-16 15:42:12.927 21870 21870 E MtaSDK : at com.yuwan.meet.e.av.a(SourceFile:121)
15309-16 15:42:12.927 21870 21870 E MtaSDK : at com.yuwan.meet.activity.P2PChatActivity.onCreateContent(SourceFile:195)
15409-16 15:42:12.927 21870 21870 E MtaSDK : at com.app.activity.CoreActivity.onCreate(SourceFile:160)
15509-16 15:42:12.927 21870 21870 E MtaSDK : at android.app.Activity.performCreate(Activity.java:7458)
15609-16 15:42:12.927 21870 21870 E MtaSDK : at android.app.Activity.performCreate(Activity.java:7448)
15709-16 15:42:12.927 21870 21870 E MtaSDK : at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286)
15809-16 15:42:12.927 21870 21870 E MtaSDK : at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409)
15909-16 15:42:12.927 21870 21870 E MtaSDK : ... 11 more
16009-16 15:42:12.934 21870 22096 I MID : read mid from InternalStorage
16109-16 15:42:12.935 21870 22096 I MID : read mid from InternalStorage:xjgD6zAYj0803BSI25xH43SSIJV973m8SnAJpFaX2PhicUBmi+vXgrY0Hzb7T3EJQUN0x+dWSUxrQn5NqA/TZABamvNptcLFULCkSnz857h296AUINU1W0VipnFAFxgpIAZox+SCzb5cMV87xk6GYGaiO0Xu

@greenrobot-team
Copy link
Collaborator

Are you using ProGuard? Check if your rules match those provided in the README.
https://github.com/greenrobot/greenDAO#r8-proguard

@chenyunecjtu
Copy link
Author

`

org.greenrobot.greendao.AbstractDao.void (org.greenrobot.greendao.internal.DaoConfig,org.greenrobot.greendao.AbstractDaoSession)(SourceFile:85)

2 com.app.model.dao.bean.ChatListDMDao.void (org.greenrobot.greendao.internal.DaoConfig,com.app.model.dao.bean.DaoSession)(SourceFile:45)
3 com.app.model.dao.bean.DaoSession.void (org.greenrobot.greendao.database.Database,org.greenrobot.greendao.identityscope.IdentityScopeType,java.util.Map)(SourceFile:49)
4 com.app.model.dao.bean.DaoMaster.com.app.model.dao.bean.DaoSession newSession()(SourceFile:58)
5 com.app.model.dao.DaoManager.com.app.model.dao.bean.DaoSession getDaoSession()(SourceFile:78)
6 com.app.model.dao.bean.ChatMsgDM.org.greenrobot.greendao.AbstractDao dao()(SourceFile:504)
7 com.app.greendaoadapter.DBModel.java.util.List findBy(com.app.greendaoadapter.IDBQuery)(SourceFile:186)
8 com.app.greendaoadapter.DBModel.java.util.List findAll(com.app.greendaoadapter.IDBQuery)(SourceFile:206)
9 com.app.model.dao.bean.ChatMsgDM.boolean readMessage()(SourceFile:755)
10 com.app.model.dao.bean.ChatMsgDM.boolean process()(SourceFile:551)

`

@chenyunecjtu
Copy link
Author

java.lang.Object org.greenrobot.greendao.database.Database.getRawDatabase() 经常报空指针错误,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants