Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"AnalyticsReceiver is not registered or is disabled."

I have just started upgrading my Android app from the old, deprecated, Analytics SDK to v4. I followed the documentation and as far as I can tell I did everything right.

On my device (which has Google Play Services installed) data seems to be sent just fine.

What worries me is that in the logs I see this message every time my app starts; AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions. -- And of course, I'd prefer to get accurate statistics.

The message seems quite clear; "Add this stuff to your AndroidManifext.xml file". The problem is that it's already there...

This is in my AndroidManifest.xml file, inside the application tag, beneath the activity and service tags that are required by the rest of my app;

    <!-- Google Analytics -->
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <receiver
        android:name="com.google.android.gms.analytics.AnalyticsReceiver"
        android:enabled="true">
        <intent-filter>
            <action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
        </intent-filter>
    </receiver>
    <service
        android:name="com.google.android.gms.analytics.AnalyticsService"
        android:enabled="true"
        android:exported="false" />

Is this a known issue? Am I missing something else?

I went for the "extend Application and have the tracker as a static property" approach that is also used in the Getting Started part of the documentation.

like image 285
RobinJ Avatar asked Jul 24 '15 10:07

RobinJ


2 Answers

You can ignore the warning and don't need to add receiver/service if you only target play-service enabled devices. Check https://developers.google.com/analytics/devguides/collection/android/v4/dispatch#manual for details.

like image 191
Sam Lu Avatar answered Oct 18 '22 04:10

Sam Lu


I had the same issue, and fixed it with

classpath 'com.google.gms:google-services:1.3.0'

whereas before I was using a beta version.

like image 29
stuart_gunn Avatar answered Oct 18 '22 06:10

stuart_gunn