java.lang.NoClassDefFoundError: Failed resolution of: Lcom/avos/avospush/notification/NotificationCompat$Builder;
at cn.leancloud.chatkit.utils.LCIMNotificationUtils.showNotification(LCIMNotificationUtils.java:68)
at cn.leancloud.chatkit.handler.LCIMMessageHandler$1.internalDone0(LCIMMessageHandler.java:96)
at cn.leancloud.chatkit.handler.LCIMMessageHandler$1.internalDone0(LCIMMessageHandler.java:88)
at com.avos.avoscloud.AVCallback.internalDone(AVCallback.java:18)
at cn.leancloud.chatkit.cache.LCIMProfileCache$1.internalDone0(LCIMProfileCache.java:76)
at cn.leancloud.chatkit.cache.LCIMProfileCache$1.internalDone0(LCIMProfileCache.java:71)
at com.avos.avoscloud.AVCallback.internalDone(AVCallback.java:18)
at cn.leancloud.chatkit.cache.LCIMProfileCache.getCachedUsers(LCIMProfileCache.java:105)
at cn.leancloud.chatkit.cache.LCIMProfileCache.getCachedUser(LCIMProfileCache.java:71)
at cn.leancloud.chatkit.handler.LCIMMessageHandler.sendNotification(LCIMMessageHandler.java:88)
at cn.leancloud.chatkit.handler.LCIMMessageHandler.onMessage(LCIMMessageHandler.java:55)
at cn.leancloud.chatkit.handler.LCIMMessageHandler.onMessage(LCIMMessageHandler.java:31)
at com.avos.avoscloud.im.v2.MessageHandler.processMessage(MessageHandler.java:33)
at com.avos.avoscloud.im.v2.MessageHandler.processEvent0(MessageHandler.java:26)
at com.avos.avoscloud.AVIMEventHandler$1.run(AVIMEventHandler.java:13)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6126)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.avos.avospush.notification.NotificationCompat$Builder"
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
09-08 16:39:45.042 28708-28708/? E/AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 22 more
按照官网的教程,导入 ChatKit 后,在测试时发现收到消息推送时会崩溃,从 log 看是和 Notification 生成相关的地方出了问题。 但是采用源代码导入的方式导入时没有这个问题。
相关 log