Sdkdbox Firebase Android conflict with SDKBOXPLAY

@nite

Hi, we trying to use latest firebase version in cocos2d-x c++, so fat we can install it but there is some issues with doc and itself plugin:

  1. If u check your git example Android.mk there is dublicated entries for included sdkbox libs

  2. When u converting google-services.json with command provided in tutorial, u get xml file where is value: google_app_id and if I add this xml file it conflicting with same value from SDKBOX Play plugin (related to leaderboards) so u need to adjust that plugin to not have same value added in manigest file and value.xml

Thank you for your feedback.

  1. fixed
  2. Please change google_app_id in sdkbox_play to google_app_id_2, do not modify the generated XML file.

should be like follow:

  • ./res/values/strings.xml

<string name="google_app_id">340534096218</string>

<string name="google_app_id_2">340534096218</string>

  • Andmanifest.xml

<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/google_app_id"/>

<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/google_app_id_2"/>

yes, I already fixed that, just made post to make u aware

One more not sure if issue or it is expected, when installed firebase thru sdkbox it modified Android.mk and added FirebasePlugin in wrong place, so it was ignored in compile:

LOCAL_WHOLE_STATIC_LIBRARIES += PluginFirebase 

LOCAL_WHOLE_STATIC_LIBRARIES := PluginGoogleAnalytics \
sdkbox \
PluginIAP \
PluginSdkboxPlay

it’s a issue, we will try to check this.

now you can modify it manually

LOCAL_WHOLE_STATIC_LIBRARIES := PluginGoogleAnalytics \
sdkbox \
PluginIAP \
PluginSdkboxPlay \
PluginFirebase

Another issue it seems app started to crsh for users using Firebase:

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.google.android.gms.measurement.AppMeasurementReceiver: java.lang.SecurityException: Neither user 10372 nor current process has android.permission.WAKE_LOCK.
       at android.app.ActivityThread.handleReceiver(ActivityThread.java:3096)
       at android.app.ActivityThread.-wrap18(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1618)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:163)
       at android.app.ActivityThread.main(ActivityThread.java:6321)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)

That strange that it need wake_lock permissions and it wasnt added to manifest file. If correctly understoot this happens due users have device without google play, so it reuqiring that permission to prevent crash - could you please check this and give some more info if this permissions shoud be added?

i think you need add this permission WAKE_LOCK from the crash info.

btw, i run sdkbox-sample-firebase on device without WAKE_LOCK, it’s there something different with sdkbox-sample-firebase?

It is same integration, seems there is some devices mostly with Android 5.0 where it crashing without this permissions, on our end we cant reproduce it - but this happens for some users so better to prevent such crashes in future by addding this permission in installation

ok, we will add WAKE_LOCK permission in installation.