Custom push notification receiver cause problem and gradle warning

After I create a custom push notification class and use it I receiver a gradle warning saying

Warning:warning: Cannot find annotation method 'value()' in type 'GuardedBy': class file for javax.annotation.concurrent.GuardedBy not found

Also, I receive a crash report on google play from Lollipop device with log

java.lang.RuntimeException: Unable to start receiver com.wordpress.suhooli.horoscopebook.receiver.BackendlessPushNotificationReceiver: java.lang.RuntimeException: AUTHENTICATION_FAILED at android.app.ActivityThread.handleReceiver(ActivityThread.java:2646) at android.app.ActivityThread.access$1700(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: java.lang.RuntimeException: AUTHENTICATION_FAILED at com.backendless.push.BackendlessBroadcastReceiver.onError(BackendlessBroadcastReceiver.java:148) at com.wordpress.suhooli.horoscopebook.receiver.BackendlessPushNotificationReceiver.onError(BackendlessPushNotificationReceiver.java:29) at com.backendless.push.BackendlessBroadcastReceiver.handleRegistration(BackendlessBroadcastReceiver.java:292) at com.backendless.push.BackendlessBroadcastReceiver.handleIntent(BackendlessBroadcastReceiver.java:159) at com.backendless.push.BackendlessBroadcastReceiver.onReceive(BackendlessBroadcastReceiver.java:128) at android.app.ActivityThread.handleReceiver(ActivityThread.java:2639) ... 9 more

What happen? How can I fix this

Hello,

Could you please provide us your manifest file?

Artur

Here what in my manifest file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.wordpress.suhooli.horoscopebook">

    &lt;uses-sdk tools:overrideLibrary=&quot;flipboard.bottomsheet, flipboard.bottomsheet.commons&quot;/&gt;

    &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
    &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
    &lt;uses-permission android:name=&quot;android.permission.GET_ACCOUNTS&quot;/&gt;
    &lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot; /&gt;
    &lt;uses-permission android:name=&quot;android.permission.VIBRATE&quot; /&gt;
    &lt;uses-permission android:name=&quot;com.google.android.c2dm.permission.RECEIVE&quot; /&gt;

    <permission android:protectionLevel="signature"
        android:name="com.wordpress.suhooli.horoscopebook.permission.C2D_MESSAGE" />
    &lt;uses-permission android:name=&quot;com.wordpress.suhooli.horoscopebook.permission.C2D_MESSAGE&quot; /&gt;
    &lt;uses-permission android:name=&quot;com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY&quot; /&gt;

    <application
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:name=".HbApplication">
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        &lt;meta-data android:name=&quot;com.facebook.sdk.ApplicationId&quot; android:value=&quot;@string/facebook_app_id&quot;/&gt;
        &lt;meta-data android:name=&quot;com.samsung.android.sdk.multiwindow.enable&quot; android:value=&quot;true&quot;/&gt;
        &lt;meta-data android:name=&quot;com.samsung.android.sdk.multiwindow.multiinstance.enable&quot; android:value=&quot;true&quot;/&gt;
        &lt;meta-data android:name=&quot;com.sec.android.multiwindow.STYLE&quot; android:value=&quot;fixedRatio&quot;/&gt;

        &lt;meta-data android:name=&quot;com.sec.android.support.multiwindow&quot; android:value=&quot;true&quot;/&gt;

        <activity
            android:name=".activity.MainActivity"
            android:screenOrientation="portrait"
            android:label="@string/app_name"
            android:theme="@style/Theme.LH">
            &lt;intent-filter&gt;
                <action android:name="android.intent.action.MAIN" />

                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
                &lt;category android:name=&quot;android.intent.category.MULTIWINDOW_LAUNCHER&quot; /&gt;
            &lt;/intent-filter&gt;
        </activity>
        <activity
            android:name=".activity.DateActivity"
            android:screenOrientation="portrait"
            android:label="@string/title_activity_dmy"
            android:theme="@style/Theme.LH">
        </activity>
        <activity
            android:name=".activity.CategoryActivity"
            android:screenOrientation="portrait"
            android:label="@string/title_activity_dmy"
            android:theme="@style/Theme.LH">
        </activity>
        <activity
            android:name=".activity.DetailActivity"
            android:screenOrientation="portrait"
            android:label="@string/title_activity_detail"
            android:theme="@style/Theme.LH.Red">
        </activity>
        <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />

        <activity android:name="com.facebook.FacebookActivity"
            android:configChanges=
                "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:theme="@android:style/Theme.Translucent.NoTitleBar"
            android:label="@string/app_name" />

        &lt;receiver android:name=&quot;.receiver.BackendlessPushNotificationReceiver&quot; android:permission=&quot;com.google.android.c2dm.permission.SEND&quot;&gt;
            &lt;intent-filter&gt;
                <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
                <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
                &lt;category android:name=&quot;com.wordpress.suhooli.horoscopebook&quot;/&gt;
            &lt;/intent-filter&gt;
        &lt;/receiver&gt;

        <provider android:authorities="com.facebook.app.FacebookContentProvider1063457037040032"
            android:name="com.facebook.FacebookContentProvider"
            android:exported="true"/>

        <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="com.wordpress.suhooli.horoscopebook.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        &lt;/provider&gt;
    </application>

&lt;/manifest&gt;

Thank you, it looks OK.

The exception you receive is thrown by Google service, not by Backendless.
Have you tried, for example, this link: http://stackoverflow.com/questions/11942736/failed-gcm-registration-in-android ?
Alex

According to link you give me, It’s because of Google account configure on his/her account right? But this error is from device running Android 5.1 (Lollipop), but according to this link https://developers.google.com/cloud-messaging/android/client “A Google account is not a requirement on devices running Android 4.0.4 or higher.”

I guess that the device has incorrect credentials. According to the link you’ve provided credentials are optional, but behaviour for incorrect credentials is unclear.

Can you verify the credentials validity? Also answer please if you have such problems on single device or on all devices?

I can only see one report of this problem on Google Play console, but on Google Play console it say “The error trace you requested is older than the retention period, but similar errors have been recorded recently”, so I guess there are more than 1 device.

Also I can’t or don’t know how to verify the credentials validity, because this error doesn’t happen on my test device (Samsung Galaxy Note 4 running Android Lollipop) except the gradle warning.

Could it because Backendless use old gcm library? Because I think google account is still require on old gcm library.

Do you mean that you don’t have error “AUTH_FAILED” on the test device, but some of your customers do?
About verification: google account is configured through the smartphone settings, so in order to verify you should have that device and navigate to “Settings” -> “Accounts” -> “google”.

Yes, I don’t have error “AUTH_FAILED” on the test device, but some of my customers do.

We haven’t faced this problem before, but we shall keep on trying to reproduce this issue.

Is it possible to get any information about model/OS version for problematic devices from your customers?

It’s Moto E with 4G LTE (2nd Gen) (surnia_cdma) Android 5.1.