firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

Topic sync or token retrieval failed on hard failure exceptions: java.util.concurrent.ExecutionException: java.io.IOException: AUTHENTICATION_FAILED. Won't retry the operation.

Open YogeshByndoor opened this issue 1 year ago • 2 comments

This crash issue was caused while fetching the token from the FirebaseMessaging.getInstance().getToken().

This task.isComplete() && task.isSuccessFull() return true But while calling task.getResult() it is crashing.

After clicking on playstore icon and try to sign up (Not completing the sign up ). This issue gets resolved automatically.

Before fetching the token we have the check if google Service is enabled or not.

final int PLAY_SERVICES_RESOLUTION_REQUEST = 9000; GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance(); int resultCode = apiAvailability.isGooglePlayServicesAvailable(activity); if (resultCode != ConnectionResult.SUCCESS) { if (apiAvailability.isUserResolvableError(resultCode)) { apiAvailability.getErrorDialog(activity, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST).show(); } else { Log.e("TAG":, "This device is not supported for GCM services"); } return false; }

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: HedgeHog

  • Firebase Component: implementation 'com.google.firebase:firebase-messaging:23.4.0'

    // Firebase Crashlytics SDK. implementation 'com.google.firebase:firebase-crashlytics:18.6.1'

    implementation 'com.google.android.gms:play-services-location:21.0.1'

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur? This could be a description, log/console output, etc.

Relevant Code:

` FirebaseMessaging.getInstance().getToken().addOnCompleteListener(new OnCompleteListener<String>() { @Override public void onComplete(@NonNull Task<String> task) { if(task.isComplete() && task.getResult() != null){ String token = task.getResult(); if (!TextUtils.isEmpty(token)) { RegisterPushNotifications.registrationId = token; registerForPushNotification(token); } } } }); // TODO(you): code here to reproduce the problem According to firebase crashlytics , Mostly crash found on Samsung device (Android 14) . We have other versions and phone makers which is also having crashes.

It is very hard to reproduce. According to our analysis , We see that this issue happens only for new users, who is registering for the first time.

YogeshByndoor avatar Feb 14 '24 07:02 YogeshByndoor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Feb 14 '24 07:02 google-oss-bot

Hi @YogeshByndoor, thanks for reporting. This seems to be a duplicate of #3040. Could you try the solution provided in here? Thanks.

lehcar09 avatar Feb 14 '24 14:02 lehcar09

Hey @YogeshByndoor. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Feb 21 '24 02:02 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@YogeshByndoor if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Feb 28 '24 02:02 google-oss-bot