Skip to content

fix(android): skip Google Sign-In package on devices without GMS#17181

Open
iospro wants to merge 1 commit intojitsi:masterfrom
iospro:feat/skip-Google-Sign-In-package-on-devices-without-GMS-Huawei
Open

fix(android): skip Google Sign-In package on devices without GMS#17181
iospro wants to merge 1 commit intojitsi:masterfrom
iospro:feat/skip-Google-Sign-In-package-on-devices-without-GMS-Huawei

Conversation

@iospro
Copy link
Contributor

@iospro iospro commented Mar 21, 2026

Problem

On Huawei devices (and other Android devices without Google Mobile Services),
loading RNGoogleSigninPackage via reflection triggers unnecessary system alerts
warning the user that Google Play Services are missing. This happens even when
Google Sign-In is never actually used in the app.

Solution

Before loading RNGoogleSigninPackage, check whether Google Play Services are
installed using PackageManager. If GMS are not present, the package is silently
skipped and a debug log entry is written instead.

Changes

  • ReactInstanceManagerHolder.java:
    • getReactNativePackages() now accepts Application context to enable the GMS check
    • Added isGooglePlayServicesAvailable(Context) — queries PackageManager for
      com.google.android.gms, no GMS dependency required, safe on any device
    • RNGoogleSigninPackage is only registered when GMS are confirmed available
    • initReactInstanceManager(app) passes app to getReactNativePackages(app)

Why PackageManager instead of GoogleApiAvailability

GoogleApiAvailability.isGooglePlayServicesAvailable() itself requires GMS to be
present and can trigger the same alerts we are trying to avoid. The PackageManager
approach has no GMS dependency and works correctly on Huawei/AOSP devices.

Behaviour

Device GMS installed Result
Standard Android RNGoogleSigninPackage loaded as before
Huawei (no GMS) Package skipped, debug log written, no alert
AOSP / emulator without GMS Package skipped silently

@jitsi-jenkins
Copy link

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants