Search code examples
javaandroidnullpointerexceptionquickblox

NullPointerException in Quickblox


I'm getting a NullPointerException. When getting the dialogs from quickblox in the log cat I can see that the dialogs are retrieved from quickblox, but when setting the adapter I get this:

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
10-26 01:04:16.331 21745-21745/? E/AndroidRuntime:     at com.quickblox.chat.model.QBDialog.getType(Unknown Source)

And this is only present in the release build. In the debug version everything works perfectly. Is there any rule I should add to the progaurd to eliminate this error?

here are my progaurd rules for quickblox:

#QuickBlox
-keep class org.jivesoftware.smack.initializer.VmArgInitializer {  public *; }
-keep class org.jivesoftware.smack.ReconnectionManager { public *; }
-keep class com.quickblox.module.c.a.c { public *; }
-keep class com.quickblox.module.chat.QBChatService { public *; }
-keep class com.quickblox.module.chat.QBChatService.loginWithUser { public *; }
-keep class com.quickblox.module.chat.listeners.SessionCallback { public *; }
-keep class * extends org.jivesoftware.smack { public *; }
-keep class org.jivesoftware.smack.** { public *; }
-keep class org.jivesoftware.smackx.** { public *; }
-keep class com.quickblox.** { public *; }
-keep class com.quickblox.module** { public *; }
-keep class * extends org.jivesoftware.smack { public *; }
-keep class * implements org.jivesoftware.smack.debugger.SmackDebugger { public *; }
-keep class org.jivesoftware.** { public *; }
-keep class com.quickblox.* { public *; }
-keep class * extends org.jivesoftware.smack { public *; }
-keep class com.quickblox.chat.QBChatService.login* { public *; }
-keep class * extends com.quickblox.core.server.BaseService { public *; }

Solution

  • Try adding:

    -keep class com.quickblox.chat.**
    -keep class com.quickblox.chat.** { *; }
    -keepnames class com.quickblox.chat.**
    -keepnames class com.quickblox.chat.** { *; }
    -keepclassmembers class com.quickblox.chat.** {*;}
    -keepclassmembers enum com.quickblox.chat.** {*;}
    -keepclassmembers interface com.quickblox.chat.** {*;}