3

After I changed my application with fabric integration to firebase Crashlytics, the application started to crash on HMS devices and gives an error as follows. I am not having any problems with Google Play devices. I changed the google-service.json and I could follow the crash information afterwards.

Does anyone have any comments?

-------Gradles------ (actual firebase implementation)

implementation "com.google.firebase:firebase-messaging:20.1.0"
implementation "com.google.firebase:firebase-core:17.2.3"
implementation "com.google.firebase:firebase-config:19.1.2"
implementation "com.google.firebase:firebase-iid:20.0.2"

implementation('com.google.firebase:firebase-crashlytics:17.3.0') {
    transitive = true
}
implementation 'com.google.firebase:firebase-analytics:18.0.0'
implementation ("android.arch.work:work-firebase:1.0.0-alpha11")

-------Logs------

2021-01-20 14:11:34.525 27076-27135/MY-APPLICATION W/Firebase-Installations: Error when communicating with the Firebase Installations server API. HTTP response: [403 Forbidden: {
      "error": {
        "code": 403,
        "message": "Requests from this Android client application MY-APPLICATION are blocked.",
        "status": "PERMISSION_DENIED",
        "details": [
          {
            "@type": "type.googleapis.com/google.rpc.ErrorInfo",
            "reason": "API_KEY_ANDROID_APP_BLOCKED",
            "domain": "googleapis.com",
            "metadata": {
              "service": "firebaseinstallations.googleapis.com",
              "consumer": "projects/651311591439"
            }
          }
        ]
      }
    }
    ]
2021-01-20 14:11:34.525 27076-27135/MY-APPLICATION W/Firebase-Installations: Firebase options used while communicating with Firebase server APIs: AIzaSyCFTn7-Nq2MuhBLaxtFteIHomgj-yaTtyU, upcall-7aaf6, 1:651311591439:android:06c16ecc4c04ca0b
2021-01-20 14:11:34.525 27076-27135/MY-APPLICATION E/Firebase-Installations: Firebase Installations can not communicate with Firebase server APIs due to invalid configuration. Please update your Firebase initialization process and set valid Firebase options (API key, Project ID, Application ID) when initializing Firebase.
2021-01-20 14:11:34.528 27076-27135/MY-APPLICATION I/QarthLog: [PatchStore] createDisableExceptionQarthFile
2021-01-20 14:11:34.528 27076-27135/MY-APPLICATION I/QarthLog: [PatchStore] create disable file for MY-APPLICATION uid is 10171
2021-01-20 14:11:34.529 27076-27176/MY-APPLICATION I/QarthLog: [PatchStore] createDisableExceptionQarthFile
2021-01-20 14:11:34.529 27076-27176/MY-APPLICATION I/QarthLog: [PatchStore] create disable file for MY-APPLICATION uid is 10171
2021-01-20 14:11:34.530 27076-27177/MY-APPLICATION I/QarthLog: [PatchStore] createDisableExceptionQarthFile
2021-01-20 14:11:34.530 27076-27177/MY-APPLICATION I/QarthLog: [PatchStore] create disable file for MY-APPLICATION uid is 10171
2021-01-20 14:11:34.531 27076-27178/MY-APPLICATION I/QarthLog: [PatchStore] createDisableExceptionQarthFile
2021-01-20 14:11:34.531 27076-27178/MY-APPLICATION I/QarthLog: [PatchStore] create disable file for MY-APPLICATION uid is 10171
    
    --------- beginning of crash
2021-01-20 14:11:34.531 27076-27176/MY-APPLICATION E/AndroidRuntime: FATAL EXCEPTION: firebase-installations-executor-3
    Process: MY-APPLICATION, PID: 27076
    java.lang.IllegalStateException: FirebaseApp was deleted
        at com.google.android.gms.common.internal.Preconditions.checkState(Unknown Source:29)
        at com.google.firebase.FirebaseApp.checkNotDeleted(FirebaseApp.java:438)
        at com.google.firebase.FirebaseApp.getApplicationContext(FirebaseApp.java:125)
        at com.google.firebase.installations.FirebaseInstallations.getMultiProcessSafePrefs(FirebaseInstallations.java:578)
        at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:355)
        at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:351)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:929)
2021-01-20 14:11:34.532 27076-27180/MY-APPLICATION I/QarthLog: [PatchStore] createDisableExceptionQarthFile
2021-01-20 14:11:34.532 27076-27180/MY-APPLICATION I/QarthLog: [PatchStore] create disable file for MY-APPLICATION uid is 10171
2021-01-20 14:11:34.532 27076-27177/MY-APPLICATION E/AndroidRuntime: FATAL EXCEPTION: firebase-installations-executor-4
    Process: MY-APPLICATION, PID: 27076
    java.lang.IllegalStateException: FirebaseApp was deleted
        at com.google.android.gms.common.internal.Preconditions.checkState(Unknown Source:29)
        at com.google.firebase.FirebaseApp.checkNotDeleted(FirebaseApp.java:438)
        at com.google.firebase.FirebaseApp.getApplicationContext(FirebaseApp.java:125)
        at com.google.firebase.installations.FirebaseInstallations.getMultiProcessSafePrefs(FirebaseInstallations.java:578)
        at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:355)
        at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:351)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:929)
2021-01-20 14:11:34.533 27076-27135/MY-APPLICATION E/AndroidRuntime: FATAL EXCEPTION: firebase-installations-executor-2
    Process: MY-APPLICATION, PID: 27076
    java.lang.IllegalStateException: FirebaseApp was deleted
        at com.google.android.gms.common.internal.Preconditions.checkState(Unknown Source:29)
        at com.google.firebase.FirebaseApp.checkNotDeleted(FirebaseApp.java:438)
        at com.google.firebase.FirebaseApp.getApplicationContext(FirebaseApp.java:125)
        at com.google.firebase.installations.FirebaseInstallations.insertOrUpdatePrefs(FirebaseInstallations.java:401)
        at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:374)
        at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:351)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:929)
2021-01-20 14:11:34.536 981-27179/? I/QarthDisFileCreator: pattern not match
2021-01-20 14:11:34.538 981-27181/? I/QarthDisFileCreator: pattern not match
2021-01-20 14:11:34.538 981-27184/? I/QarthDisFileCreator: pattern not match
2021-01-20 14:11:34.538 27076-27183/MY-APPLICATION I/QarthLog: [PatchStore] createDisableExceptionQarthFile
2021-01-20 14:11:34.538 27076-27183/MY-APPLICATION I/QarthLog: [PatchStore] create disable file for MY-APPLICATION uid is 10171
2021-01-20 14:11:34.539 27076-27178/MY-APPLICATION E/AndroidRuntime: FATAL EXCEPTION: firebase-installations-executor-5
    Process: MY-APPLICATION, PID: 27076
    java.lang.IllegalStateException: FirebaseApp was deleted
        at com.google.android.gms.common.internal.Preconditions.checkState(Unknown Source:29)
        at com.google.firebase.FirebaseApp.checkNotDeleted(FirebaseApp.java:438)
        at com.google.firebase.FirebaseApp.getApplicationContext(FirebaseApp.java:125)
        at com.google.firebase.installations.FirebaseInstallations.getMultiProcessSafePrefs(FirebaseInstallations.java:578)
        at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:355)
        at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:351)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:929)
2021-01-20 14:11:34.539 27076-27180/MY-APPLICATION E/AndroidRuntime: FATAL EXCEPTION: firebase-installations-executor-6
    Process: MY-APPLICATION, PID: 27076
    java.lang.IllegalStateException: FirebaseApp was deleted
        at com.google.android.gms.common.internal.Preconditions.checkState(Unknown Source:29)
        at com.google.firebase.FirebaseApp.checkNotDeleted(FirebaseApp.java:438)
        at com.google.firebase.FirebaseApp.getApplicationContext(FirebaseApp.java:125)
        at com.google.firebase.installations.FirebaseInstallations.getMultiProcessSafePrefs(FirebaseInstallations.java:578)
        at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:355)
        at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:351)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:929)
2021-01-20 14:11:34.540 981-27182/? I/QarthDisFileCreator: pattern not match
2021-01-20 14:11:34.540 981-27186/? I/QarthDisFileCreator: pattern not match
2021-01-20 14:11:34.540 27076-27183/MY-APPLICATION E/AndroidRuntime: FATAL EXCEPTION: firebase-installations-executor-7
    Process: MY-APPLICATION, PID: 27076
    java.lang.IllegalStateException: FirebaseApp was deleted
        at com.google.android.gms.common.internal.Preconditions.checkState(Unknown Source:29)
        at com.google.firebase.FirebaseApp.checkNotDeleted(FirebaseApp.java:438)
        at com.google.firebase.FirebaseApp.getApplicationContext(FirebaseApp.java:125)
        at com.google.firebase.installations.FirebaseInstallations.getMultiProcessSafePrefs(FirebaseInstallations.java:578)
        at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:355)
        at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$2(FirebaseInstallations.java:351)
        at com.google.firebase.installations.FirebaseInstallations$$Lambda$4.run(Unknown Source:4)
        at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:929)
basari
  • 31
  • 1
  • 4

2 Answers2

0
  1. You have integrated firebase-crashlytics.

Firebase SDKs can be divided into three categories: Play services required; Play services recommended; Play services not required

According to the Firebase documentation, Crashlytics does not depend on the GMS. Therefore, the error is irrelevant to the HMS devices.

  1. Your app has integrated GMS. As new Huawei phones are banned from using GMS, you app, if with GMS integrated, will be unable to run on new Huawei phones. If you want your app to run on these phones, integrate Huawei Mobile Services (HMS).

In the list you provided, you use these GMS services: • firebase-messaging • firebase-analytics

You can refer to the following Huawei mobile services: Push Kit, Analytics Kit

  1. You are advised to use the solution for integrating both GMS and HMS. The advantages are as follows:
  • Reduce the complexity of app packaging. A package can be released to both Google Play and HUAWEI AppGallery.
  • Reduce the code maintenance cost. The HMS+GMS adaptation layer code is added to the original logic code. In this way, proper code can be automatically called based on the mobile phone. That is, you do not need to modify existing logic code or maintain two sets of code.

You are advised to use HUAWEI HMS ToolKit, which can help you quickly add the HMS+GMS adaptation layer code and upgrade your logic code to support both GMS and HMS.

Please kindly refer to these SOF answers:

https://stackoverflow.com/a/64782622/13329100

https://stackoverflow.com/a/64874560/13329100

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
0

Firebase Crashlytics is not GMS dependent but if you are using any other GMS dependent services along with, please use alternative HMS services. Also, Huawei has its own AG connect crash service. You can integrate HMS crash, please refer following documentation for details

Other possibility, if you have changed your google-services.json file recently then try deleting build folder from android project and re-build again.

Zinna
  • 1,947
  • 2
  • 5
  • 20