QuickBlox / quickblox-android-sdk

QuickBlox Android SDK includes code snippets with main use cases and framework JAR library.
BSD 3-Clause "New" or "Revised" License
417 stars 697 forks source link

Why is com.quickblox:quickblox-android-sdk-messages importing GCM #425

Closed ubarua123 closed 3 years ago

ubarua123 commented 7 years ago

I am using FCM. Why is it importing GCM as well. Maybe separate out the two? Also when are you guys updating play services to 11.0.2. Just because of this issue I am not able to upgrade to 11.0.2 because of this conflict and I get Error:Execution failed for task ':app:transformClassesWithJarMergingForProductionDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/iid/zzc.class

RomanPronin commented 7 years ago

Hi, @ubarua123, you can always use exclude module option in your grade file to remove any module you want. Something like that: compile ("com.quickblox:quickblox-android-sdk-messages:$rootProject.qbSdkVersion" ) { exclude group: 'com.google.android.gms', module: 'play-services' }

ubarua123 commented 7 years ago

Unfortunately This does not solve the problem.

+--- com.quickblox:quickblox-android-sdk-messages:3.3.3 | +--- com.quickblox:quickblox-android-sdk-core:3.3.3 () | +--- com.google.firebase:firebase-messaging:10.2.1 -> 11.0.2 | | +--- com.google.firebase:firebase-iid:[11.0.2] -> 11.0.2 | | | +--- com.google.android.gms:play-services-basement:[11.0.2] -> 11.0.2 | | | | --- com.android.support:support-v4:25.2.0 -> 25.4.0 () | | | --- com.google.firebase:firebase-common:[11.0.2] -> 11.0.2 | | | +--- com.google.android.gms:play-services-basement:[11.0.2] -> 11.0.2 () | | | --- com.google.android.gms:play-services-tasks:[11.0.2] -> 11.0.2 | | | --- com.google.android.gms:play-services-basement:[11.0.2] -> 11.0.2 () | | +--- com.google.android.gms:play-services-basement:[11.0.2] -> 11.0.2 () | | --- com.google.firebase:firebase-common:[11.0.2] -> 11.0.2 () | --- com.google.android.gms:play-services-gcm:10.2.1 | +--- com.google.android.gms:play-services-base:10.2.1 -> 11.0.2 | | +--- com.google.android.gms:play-services-basement:[11.0.2] -> 11.0.2 () | | --- com.google.android.gms:play-services-tasks:[11.0.2] -> 11.0.2 () | +--- com.google.android.gms:play-services-basement:10.2.1 -> 11.0.2 () | --- com.google.android.gms:play-services-iid:10.2.1 | +--- com.google.android.gms:play-services-base:10.2.1 -> 11.0.2 () | --- com.google.android.gms:play-services-basement:10.2.1 -> 11.0.2 (*)

The module is play-services-gcm

If i remove that, i get a crash

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.quickblox.messages.services.SubscribeTaskManager"

if you open SubscribeTaskManager you'll see it imports:

import com.google.android.gms.gcm.GcmNetworkManager; import com.google.android.gms.gcm.GcmTaskService; import com.google.android.gms.gcm.OneoffTask; import com.google.android.gms.gcm.TaskParams; import com.google.android.gms.gcm.OneoffTask.Builder;

Which brings me back to the original problem:

Error:Execution failed for task ':app:transformClassesWithJarMergingForProductionDebug'.

RomanPronin commented 7 years ago

Ok, if you use google play services version higher then in SDK, just add explicit dependency: compile "com.google.android.gms:play-services-gcm:11.0.2" compile "com.google.firebase:firebase-messaging:11.0.2" compile "com.google.firebase:firebase-core:11.0.2"

BTW, in SDK 3.3.4 we've updated play services to 11.0.2.

g123k commented 7 years ago

Same question here. With FCM the app does not compile, with the duplicate entry error.

And with the exclude block, the app is crashing with java.lang.ClassNotFoundException.

api ('com.quickblox:quickblox-android-sdk-messages:3.3.1') { exclude group: 'com.google.android.gms', module: 'play-services-gcm' }

ghost commented 3 years ago

Hello QuickBlox customers,

This is Nikolay from QuickBlox support.

The issue was closed as it is outdated.

Please check the relevant section of our documentation here: https://docs.quickblox.com/docs/android-push-notifications

Also, please update the SDK to the latest version: https://github.com/QuickBlox/quickblox-android-sdk-releases/releases/tag/3.9.11

Additionally, please check our new samples: https://docs.quickblox.com/docs/code-samples#chat-samples

If it is still relevant after reviewing the updated information, feel free to open a new issue.

Have a nice day.