Enter the chat in the QuickBlox app for Android

I am developing an android application for communication and I am using Quickblox for this. I am integrating the QuickBlox library " quickblox-android-1.2.4.jar " for QuickBlox SDK 1.2.4 into an android application. I have read this , this and many other QB reference guides. The code works exactly as I want, but the problem occurs when I use Proguard QBChatService.getInstance (). LoginWithUser doesn't work. My code for this:

                    new SessionCallback() {
                        public void onLoginSuccess() {

                            Log.i("success when login", "success:");


                        public void onLoginError(String error) {
                            Log.i("Error", "Error: " + error);


But it doesn't print success on login and error. Not sure why? This works great if I uninstall Proguard and run it in my other demo app. Therefore, the only plausible reason may be Proguard. Can you help me with this issue by specifying which classes to keep in my "proguard-project.txt" (if so).

I already mentioned below classes:

-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 *; }


I obviously wrote the code for QBAuth.createSession before logging in and it works with success as stated here . So it isn't.

Please suggest me if I miss something here. Thank you in advance.


source to share

1 answer

I had similar problems, I needed to extend the proguard config like this and now it works for me:

-keep class org.jivesoftware.smack.** { public *; }
-keep class org.jivesoftware.smackx.** { public *; }
-keep class com.quickblox.** { public *; }
-keep class * extends org.jivesoftware.smack { public *; }
-keep class * implements org.jivesoftware.smack.debugger.SmackDebugger { public *; }




All Articles