SDKBoxPlay - android integration issue (v2.5.1.2)

Hi guys,

I am integrating sdkboxplay plugin. I followed the steps described in the tutorial. Unfortunately, I can’t compile it for Android.

cocos2dx v3.15.1
SDKBoxPlay v2.5.1.2

I get lots of duplicates like:

java.lang.RuntimeException: Duplicate class android.support.annotation.AnimRes found in modules support-annotations-26.1.0.jar (com.android.support:support-annotations:26.1.0) and support-annotations-27.1.1.jar (support-annotations-27.1.1.jar)
Duplicate class android.support.annotation.WorkerThread found in modules support-annotations-26.1.0.jar (com.android.support:support-annotations:26.1.0) and support-annotations-27.1.1.jar (support-annotations-27.1.1.jar)
Duplicate class android.support.annotation.XmlRes found in modules support-annotations-26.1.0.jar (com.android.support:support-annotations:26.1.0) and support-annotations-27.1.1.jar (support-annotations-27.1.1.jar)
Duplicate class com.google.ads.AdRequest found in modules classes.jar (com.google.android.gms:play-services-ads-lite:17.2.0) and google-play-services.jar (google-play-services.jar)
Duplicate class com.google.android.gms.auth.api.signin.GoogleSignInAccount found in modules classes.jar (com.google.android.gms:play-services-base:16.0.1) and google-play-services.jar (google-play-services.jar)
Duplicate class com.google.android.gms.tasks.zzs found in modules classes.jar (com.google.android.gms:play-services-tasks:16.0.1) and google-play-services.jar (google-play-services.jar)

Where should I look?

Is there a way to download older plugin v2.4.3.3?

Thank you,
kds

Here are my dependencies:

dependencies {
implementation fileTree(dir: ‘libs’, include: [’*.jar’])
implementation project(’:libcocos2dx’)
implementation ‘com.google.firebase:firebase-core:16.0.9’
implementation ‘com.google.firebase:firebase-ads:17.2.1’
}

apply plugin: ‘com.google.gms.google-services’

Hmm… I have just removed google-play-services.jar from cocos/platform/android/java/libs/gps/libs and it compiled.

Why do I have to remove anything after plugin integration to make it compile? :slight_smile:

To compile it:

Remove android-support-v4.jar from cocos/platform/android/java/libs
Remove support-annotations-27.1.1 from cocos/platform/android/java/libs
Remove google-play-services.jar from cocos/platform/android/java/libs/gps/libs

Change gps version number in cocos/platform/android/java/libs/gps/libs/res/values/version.xml to 12451000 (you will get crash after SDKBoxPlay init, check the logs in the console).

Add dependencies:

implementation ‘com.google.android.gms:play-services-auth:17.0.0’
implementation ‘com.google.android.gms:play-services-base:17.1.0’
implementation ‘com.google.android.gms:play-services-games:19.0.0’

After that I was able to compile, initialize gps and call signin.

We can ask @yinjimmy to review this thread.

the gps and android-support* libraries has been replaced by implementation 'com.google.android.gms:play-services-**'.

We need to update the docs, because SDKBox has remove eclipse support but keep the libraries.

Thanks,