Skip to content

[🐛] IllegalStateException makeGooglePlayServicesAvailable must be called from the main thread #8948

@lorenzomilesi

Description

@lorenzomilesi

Issue

After upgrading from 23.8.6 to 23.8.8, I started getting this Sentry reports for some Android 10 Huawei devices.

java.lang.IllegalStateException: makeGooglePlayServicesAvailable must be called from the main thread
    at com.google.android.gms.common.internal.Preconditions.checkMainThread(SourceFile:3)
    at com.google.android.gms.common.GoogleApiAvailability.makeGooglePlayServicesAvailable(:4)
    at io.invertase.firebase.utils.ReactNativeFirebaseUtilsModule.androidMakePlayServicesAvailable(:16)
    at com.facebook.jni.NativeRunnable.run(SourceFile)
    at android.os.Handler.handleCallback(Handler.java:900)
    at android.os.Handler.dispatchMessage(Handler.java:103)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(:5)
    at android.os.Looper.loop(Looper.java:219)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.startNewBackgroundThread$lambda$0(:14)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.a(:0)
    at com.facebook.react.bridge.queue.b.run(:2)
    at java.lang.Thread.run(Thread.java:929)

Project Files

Javascript

Click To Expand

package.json:

    "@invertase/react-native-apple-authentication": "2.5.1",
    "@react-native-firebase/analytics": "23.8.8",
    "@react-native-firebase/app": "23.8.8",
    "@react-native-firebase/messaging": "23.8.8",
    "@react-navigation/bottom-tabs": "7.15.5",
    "@react-navigation/elements": "2.9.10",
    "@react-navigation/native": "7.1.33",
    "@react-navigation/native-stack": "7.14.5",
    "@sentry/react-native": "8.4.0",
    "react": "19.2.3",
    "react-native": "0.83.4",
    "react-native-gesture-handler": "2.30.0",
    "react-native-reanimated": "4.2.2",
    "react-native-screens": "4.24.0",
    "react-native-worklets": "0.7.4",

firebase.json for react-native-firebase v6:

# N/A

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

System:
  OS: macOS 15.7
  CPU: (8) arm64 Apple M2
  Memory: 113.86 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.7.0
  Yarn:
    version: 3.6.4
  npm:
    version: 11.5.1
  Watchman:
    version: 2025.06.23.00
Managers:
  CocoaPods:
    version: 1.16.2
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.1
      - iOS 26.1
      - macOS 26.1
      - tvOS 26.1
      - visionOS 26.1
      - watchOS 26.1
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.27812.49.2514.14217341
  Xcode:
    version: 26.1.1/17B100
Languages:
  Java:
    version: 17.0.12
  Ruby:
    version: 3.1.7
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.2
    wanted: 20.0.2
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.83.4
    wanted: 0.83.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • 23.8.8
  • Firebase module(s) you're using that has the issue:
    • e.g. Instance ID
  • Are you using TypeScript?
    • Y


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions