Android Question firebase analytics not work

analizer3816

Member
Licensed User
Longtime User
hello,
I add analytics, notification(fcm) then
crash reports : ok
notification : ok
analytics : no

I tested about 2 weeks but no data send to analytics dashboard.

I see unfiltered log found
B4X:
AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See http://goo.gl/8Rd3yj for instructions.
AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions.

AppMeasurementService not registered/enabled
Uploading is not possible. App measurement disabled

this is manifest code
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
'************ Google Play Services Base ************
AddApplicationText(
   <activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
  android:theme="@android:style/Theme.Translucent.NoTitleBar"
  android:exported="false"/>
    <meta-data
  android:name="com.google.android.gms.version"
  android:value="@integer/google_play_services_version" />
)
'************ Google Play Services Base (end) ************
'************ Firebase Base ************
CreateResourceFromFile("google-services", "google-services.json")
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(com.google.android.c2dm.permission.RECEIVE)
AddPermission(${applicationId}.permission.C2D_MESSAGE)
AddManifestText( <permission android:name="${applicationId}.permission.C2D_MESSAGE"
  android:protectionLevel="signature" />)
AddApplicationText(
<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>

  <service
  android:name="com.google.android.gms.measurement.AppMeasurementService"
  android:enabled="true"
  android:exported="false"/>
   <provider
  android:authorities="${applicationId}.firebaseinitprovider"
  android:name="com.google.firebase.provider.FirebaseInitProvider"
  android:exported="false"
  android:initOrder="100" />
    <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>

  <service
  android:name="com.google.android.gms.measurement.AppMeasurementService"
  android:enabled="true"
  android:exported="false"/>
   <receiver
  android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
  android:exported="true"
  android:permission="com.google.android.c2dm.permission.SEND" >
  <intent-filter>
  <action android:name="com.google.android.c2dm.intent.RECEIVE" />
  <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
  <category android:name="${applicationId}" />
  </intent-filter>
  </receiver>
    <receiver
  android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
  android:exported="false" />


  <service
  android:name="com.google.firebase.iid.FirebaseInstanceIdService"
  android:exported="true">
  <intent-filter android:priority="-500">
  <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
  </intent-filter>
  </service>
)
'************ Firebase Base (end) ************
'************ Firebase Notifications ************
AddApplicationText(
    <service
  android:name="com.google.firebase.messaging.FirebaseMessagingService"
  android:exported="true">
  <intent-filter android:priority="-500">
  <action android:name="com.google.firebase.MESSAGING_EVENT" />
  </intent-filter>
  </service>
   <service android:name="anywheresoftware.b4a.objects.FirebaseNotificationsService">
     <intent-filter>
  <action android:name="com.google.firebase.MESSAGING_EVENT"/>
     </intent-filter>
   </service>
)
'************ Firebase Notifications (end)************
'************ Firebase Analytics ************
AddApplicationText(
  <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>

  <service
  android:name="com.google.android.gms.measurement.AppMeasurementService"
  android:enabled="true"
  android:exported="false"/>

  <service android:name="com.google.firebase.crash.internal.service.FirebaseCrashReceiverService"
  android:process=":background_crash"/>

  <service android:name="com.google.firebase.crash.internal.service.FirebaseCrashSenderService"
  android:process=":background_crash"/>
)
'************ Firebase Analytics (end) ************

please suggest me
thanks
 

analizer3816

Member
Licensed User
Longtime User
yes, please check my sample project
thanks

i tested on samsung note5 + android 7.0 + android jar 22-25
 

Attachments

  • 11.zip
    8.2 KB · Views: 163
Upvote 0

analizer3816

Member
Licensed User
Longtime User
this line
B4X:
#AdditionalJar: com.google.android.gms:play-services-location
does it required for firebase ?
because former I can use admob, crash reports and notification without this code.

I use adb for logging, this problem still exists on my app. but other apps I can see analytics data:(:(
B4X:
09-10 19:18:33.886 I/FA      (15377): To enable faster debug mode event logging run:
09-10 19:18:33.886 I/FA      (15377):   adb shell setprop debug.firebase.analytics.app com2560.testfirebase2017
09-10 19:18:33.886 D/FA      (15377): Debug-level message logging enabled
09-10 19:18:33.900 V/FA      (15377): Cancelling job. JobID: 131060585
09-10 19:18:33.904 V/FA      (15377): Registered activity lifecycle callback
09-10 19:18:33.910 V/FA      (15377): onActivityCreated
09-10 19:18:33.916 E/FA      (15377): AppMeasurementService not registered/enabled
09-10 19:18:33.917 E/FA      (15377): Uploading is not possible. App measurement disabled
 
Last edited:
Upvote 0
Top