注册

今天突然出现的问题(我也不知道怎么描述了,有报错信息截图)


求大神帮忙看一下什么情况啊
今天就只写了个联系人的全局监听器,现在就算注释掉这个也会报错

已邀请:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.pingtou.loc, PID: 6446
java.lang.RuntimeException: Unable to create application com.pingtou.loc.IMApplication: java.lang.NullPointerException: Attempt to invoke virtual method ‘com.hyphenate.chat.adapter.EMAContactManager com.hyphenate.chat.adapter.EMAChatClient.getContactManager()’ on a null object reference
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6629)
at android.app.ActivityThread.access$1400(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1894)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:239)
at android.app.ActivityThread.main(ActivityThread.java:7604)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:953)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘com.hyphenate.chat.adapter.EMAContactManager com.hyphenate.chat.adapter.EMAChatClient.getContactManager()’ on a null object reference
at com.hyphenate.chat.EMClient.contactManager(Unknown Source:8)
at com.pingtou.loc.model.EventListener.(EventListener.java:84)
at com.pingtou.loc.model.Model.init(Model.java:43)
at com.pingtou.loc.IMApplication.onCreate(IMApplication.java:24)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1189)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6624)
at android.app.ActivityThread.access$1400(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1894)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:239)
at android.app.ActivityThread.main(ActivityThread.java:7604)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:953)

这个报错是空指针的报错,你可以检查下你的初始化有没有问题,是不是按照文档初始化的

要回复问题请先登录注册