SDKBOX 2.3.15 Release - Firebase

AHA, which cocos version?

3.14.1 - acctually failed to patch file AppDelegate.cpp not big issue - as it is clear what u need to do to make it work there(probably it failed due we have already a lot of code in appdelegate and installed can’t find proper place where to add include/init).

I’m more wondering about this 0:71: execution error: “http://sdkbox-doc.github.io/en/plugins/firebase/v3-cpp/” doesn’t understand the “open location” message

It seems something new - probably browser cant open that url.

One complain I would have regarding bundled google play services - it still have Build tools in gradle 22.0.1 I think everyone already moved after cocos 3.15 to build tools 25.0.0 - so u should change to this one in bundle.

Also I dont see where is debug events? Firebase have debug parameter to see all events live - not sure if u implemented this in your code - can’t find ti so far.

It seems Firebase plugin doesn’t work:( I have all files set, xml added to res/values but no any event showing in dashboard.

Should wait for several hours.

In Firebase c++ SDK? In SDKBox, we provide a native SDK wrapper plugin.
If you want to immediately verify events what are being sent, take a look at

We doc it here.

I reproduce this issue on macOS 10.12.5, but chrome can open the url. It seems an issue (1 2 3) on the latest macOS.

##Update:
Got some tester data
Android:

iOS:

I will try once more - to see what wrong goes here, like Firebase have streamview where u can see realtime events. I was playing with it integrating firebase myself - now I used skdbox with same app and no events comming - there should not be delay in streamview.

So I’m assuming some lib missing or something hapened with config xml file. The only thing I see in console:

07-09 21:27:12.346 11186-11186/? I/FA: App measurement is starting up, version: 9683
07-09 21:27:12.346 11186-11186/? I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
07-09 21:27:12.363 11186-11186/? I/FA: To enable faster debug mode event logging run:

This looks strange:

07-10 13:58:17.497 18251-18275/? E/Firebase: setScreenName is not support on android
07-10 13:58:17.499 18251-18275/? D/cocos2d: android SDK version:24
07-10 13:58:17.499 18251-18333/? E/FA: AppMeasurementService not registered/enabled
07-10 13:58:17.499 18251-18333/? E/FA: Uploading is not possible. App measurement disabled

I’m not sure but after multiple tries I’m assuming you didn’t tested your plugin with gradle setup?

In git i see only example for ant and not gradle/android-studio.

After experiments:

  1. Removed from cocos2d-x build.gradle:

compile project(’:gps’)

  1. Added into proj.adnroid-studio: build gradle:

    dependencies {
    classpath ‘com.android.tools.build:gradle:2.3.3’

         classpath 'com.google.gms:google-services:3.0.0'
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
     }
    
  2. Added into app build.gradle:

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

  1. deleted from libs folder:
    sdkbox-firebase.jar

  2. deleted from res/values/ googelplayservices.xml and added google-services.json to app folder

I successfully compiled project and immediately received debug event.

So I don’t se reason to use conversion from json to xml as it is done automaticly if u attaching google play services thru gradle, your setup is incorrect for gradle…

App measurement disabled?

can you add follow to your manifest

<service android:name="com.google.android.gms.measurement.AppMeasurementService"
            android:enabled="true"
            android:exported="false"/>
        <receiver android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
            android:enabled="true">
            <intent-filter>
                <action android:name="com.google.android.gms.measurement.UPLOAD" />
            </intent-filter>
        </receiver>

yep,

this is a way,

use the solution, you replace firebase lib sdkbox provide with firebase gradle lib. (firebase lib in sdkbox is come from firebase gradle, they are same)

I have added this alreaady - unpacked apk to check if it is still there… it there but doesnt work - could be some conflcit with admob/facebook/google analytics… who knows :slight_smile:

I test on -x 3.15.1 android studio, works fine. I’ll try 3.14.1

tried 3.14.1, works fine.

  1. cocos new -l cpp cppTest
  2. replace applicationId with com.sdkbox.test.app.firebase in app/build.gradle
  3. cp googleservices.xml from sdkbox-sample-firebase cpp to ./proj.android-studio/app/res/values/googleservices.xml
  4. modify HelloWorldScene.cpp to invoke firebase logevent function
  5. cocos run -p android --android-studio

so you getting events in debug mode? Now trying myself hello world 3.15.1

yep

i use this to check the log event:

``
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC

to be sure you see your events in Firebase console?

as firebase official document, https://firebase.google.com/docs/analytics/android/events#view_events_in_the_android_studio_debug_log

use this can check event immediately.

in firebase console, must wait hours.

actually no.

To enable Analytics Debug mode on an Android device, execute the following commands:

adb shell setprop debug.firebase.analytics.app <package_name>

This behavior persists until you explicitly disable Debug mode by executing the following command:

adb shell setprop debug.firebase.analytics.app .none.

If u running that first command:
adb shell setprop debug.firebase.analytics.app <package_name>

you should immediately get debug events in Firebase dashboards in DebugView section (as my attached screenshot), by some reason cocos2d-x bundled firebase not sending events there. If I removing sdkbox-firabase and using original everything works imidiatly - Im receiving events in DebugView.

I just installed Hello World 3.15.1 imported firebase and still same issue. There is my log:

07-10 18:02:33.995 V/FA      ( 1699): App package, google app id: com.mygame.test, 1:4534534535:android:5345353533555fa
07-10 18:02:33.996 I/FA      ( 1699): Faster debug mode event logging enabled. To disable, run:
07-10 18:02:33.996 I/FA      ( 1699):   adb shell setprop debug.firebase.analytics.app .none.
07-10 18:02:33.996 D/FA      ( 1699): Debug-level message logging enabled
07-10 18:02:34.001 V/FA      ( 1699): Cancelling job. JobID: 816241085
07-10 18:02:34.002 V/FA      ( 1699): Registered activity lifecycle callback
07-10 18:02:34.005 V/FA      ( 1699): Persisting first open: 1499698953987
07-10 18:02:34.012 E/FA      ( 1699): AppMeasurementService not registered/enabled
07-10 18:02:34.012 E/FA      ( 1699): Uploading is not possible. App measurement disabled
07-10 18:02:34.005 V/FA      ( 1699): Persisting first open: 1499698953987
07-10 18:02:34.012 E/FA      ( 1699): AppMeasurementService not registered/enabled
07-10 18:02:34.012 E/FA      ( 1699): Uploading is not possible. App measurement disabled
07-10 18:02:34.726 D/FA-SVC  ( 5973): Got package added intent: com.mygame.test
07-10 18:02:34.012 E/FA      ( 1699): AppMeasurementService not registered/enabled
07-10 18:02:34.012 E/FA      ( 1699): Uploading is not possible. App measurement disabled
07-10 18:02:34.726 D/FA-SVC  ( 5973): Got package added intent: com.mygame.test
07-10 18:02:37.074 V/FA      ( 1577): Inactivity, disconnecting from the service
07-10 18:02:34.012 E/FA      ( 1699): Uploading is not possible. App measurement disabled
07-10 18:02:34.726 D/FA-SVC  ( 5973): Got package added intent: com.mygame.test

As this log states - firebase can’t upload data by some reason and it’s seems inside sdkbox jar.

is there same different from my steps?

  1. cocos new -l cpp cppTest
  2. replace applicationId with com.sdkbox.test.app.firebase in app/build.gradle
  3. cp googleservices.xml from sdkbox-sample-firebase cpp to ./proj.android-studio/app/res/values/googleservices.xml
  4. modify HelloWorldScene.cpp to invoke firebase logevent function
  5. cocos run -p android --android-studio

Just in case there is about debugView:
https://firebase.google.com/docs/analytics/debugview

I have exactly same steps like your, only I have my own googleservices.xml and package id.

It would look like this:

1. cocos new -l cpp -p com.mygame.test mygamest
2. cp googleservices.xml (my generated)  to ./proj.android-studio/app/res/values/googleservices.xml
3. sdkbox import firebase
4. modify HelloWorldScene.cpp to invoke firebase logevent function (skdbox already placed code there for init)
5. cocos run -p android --android-studio

I think something is realted to this error:

AppMeasurementService not registered/enabled
07-10 18:02:34.012 E/FA ( 1699): Uploading is not possible. App measurement disabled

Like inside skdbox jar something is missing or wrongly hardcoded and due this debug events not sent to firebase.

can you use

com.sdkbox.test.app.firebase
and
https://github.com/sdkbox/sdkbox-sample-firebase/blob/master/cpp/proj.android/res/values/googleservices.xml
to try

or share your googleservices.xml, application id with me

I sent my xml.

Was trying your provided, seesm to be same issue:

07-10 18:32:03.781 I/FA      (22738): App measurement is starting up, version: 11010
07-10 18:32:03.781 I/FA      (22738): To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
07-10 18:32:03.786 V/FA      (22738): Collection enabled
07-10 18:32:03.786 V/FA      (22738): App package, google app id: com.sdkbox.test.app.firebase, 1:983552352747:android:2a571907b792f3c2
07-10 18:32:03.787 I/FA      (22738): To enable faster debug mode event logging run:
07-10 18:32:03.787 I/FA      (22738):   adb shell setprop debug.firebase.analytics.app com.sdkbox.test.app.firebase
07-10 18:32:03.787 D/FA      (22738): Debug-level message logging enabled
07-10 18:32:03.792 V/FA      (22738): Cancelling job. JobID: 1030263612
07-10 18:32:03.793 V/FA      (22738): Registered activity lifecycle callback
07-10 18:32:03.795 V/FA      (22738): Persisting first open: 1499700723778
07-10 18:32:03.801 E/FA      (22738): AppMeasurementService not registered/enabled
07-10 18:32:03.801 E/FA      (22738): Uploading is not possible. App measurement disabled
07-10 18:32:08.547 V/FA      (19511): Inactivity, disconnecting from the service
07-10 18:32:21.159 I/FA      (23116): App measurement is starting up, version: 9683
07-10 18:32:21.159 I/FA      (23116): To enable debug logging run: adb shell setprop log.tag.FA VERBOSE

Also I’m checking what inside sdkbox-firebase.jar and there is Appmeasurment class used which now is depreciated seems: https://firebase.google.com/docs/reference/android/com/google/android/gms/measurement/AppMeasurement maybe it causing issue?