Cannot reinstall com.google.android.gms.home

90 Views Asked by At

I'm working on an IoT project using Matter standard.

Untill today, an overlay appeared on my phone when I turned on an unpaired Matter device. Also, I could manually add device in Google Home or Matter sample app.

However, today the overlay didn't appear anymore. I tried to add device manually from Google Home > Devices > Add device; but when I press Matter-enabled device, it goes back to Devices page.

There is no Matter devices option in Settings > Google > All services > Devices & sharing. Also when I select Devices in this menu, a loading screen appears and never ends loading.

Pressing + button in Matter sample app doesn't open anything also. This is the output of adb logcat when I press the button:

01-23 22:23:04.657 19286 19286 D GHSAFM-3p-ecosystem-HomeFragment: addDeviceButton.setOnClickListener
01-23 22:23:04.657 19286 19286 D GHSAFM-3p-ecosystem-HomeViewModel: unsubscribeToPeriodicUpdates()
01-23 22:23:04.658 19286 19286 D GHSAFM-3p-ecosystem-HomeViewModel: CommissionDevice: starting
01-23 22:23:04.661 19286 19286 D GHSAFM-3p-ecosystem-HomeFragment$setupObservers: commissionDeviceStatus.observe: status [com.google.homesampleapp.TaskStatus$InProgress@4acfe1a]
01-23 22:23:04.682 19286 19347 W ConnectionStatusConfig: Dynamic lookup for intent failed for action: com.google.android.gms.home.service.START
01-23 22:23:04.694 19286 19347 W GmsClient: unable to connect to service: com.google.android.gms.home.service.START on com.google.android.gms
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel: com.google.android.gms.common.api.ApiException: 17: API: CommissioningClient.API is not available on this device. Connection failed with: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(com.google.android.gms:play-services-base@@18.2.0:3)
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at com.google.android.gms.common.api.internal.ApiExceptionMapper.getException(com.google.android.gms:play-services-base@@18.2.0:1)
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at com.google.android.gms.common.api.internal.zag.zad(com.google.android.gms:play-services-base@@18.2.0:1)
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at com.google.android.gms.common.api.internal.zabq.zaE(com.google.android.gms:play-services-base@@18.2.0:7)
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at com.google.android.gms.common.api.internal.zabq.zaD(com.google.android.gms:play-services-base@@18.2.0:2)
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at com.google.android.gms.common.api.internal.zabq.zar(com.google.android.gms:play-services-base@@18.2.0:24)
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at com.google.android.gms.common.api.internal.zabt.run(com.google.android.gms:play-services-base@@18.2.0:12)
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at android.os.Handler.handleCallback(Handler.java:942)
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at android.os.Handler.dispatchMessage(Handler.java:99)
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at android.os.Looper.loopOnce(Looper.java:211)
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at android.os.Looper.loop(Looper.java:300)
01-23 22:23:04.698 19286 19286 E GHSAFM-3p-ecosystem-HomeViewModel:     at android.os.HandlerThread.run(HandlerThread.java:67)
01-23 22:23:04.698 19286 19286 D GHSAFM-3p-ecosystem-HomeFragment$setupObservers: commissionDeviceStatus.observe: status [com.google.homesampleapp.TaskStatus$Failed@d9f1b54]

Seems like com.google.android.gms.home isn't there on my phone anymore. I tried uninstalling Google Play Services updates, reinstalling it, updating it to Beta, uninstalling and reinstalling Google Home and Matter sample app and even factory reset! None of these fixed the problem.

Isn't there any way to force com.google.android.gms.home module to install instead of waiting for automatic module delivery?

Phone info:

  • Redmi Note 12 Pro 5G Global
  • MIUI 14.0.6 (Android 13)
  • Google Play services 24.03.14 (190400-599341201)
1

There are 1 best solutions below

0
Yiğit On

Many matter features on Android today depends on the availability of home module, which is served as part of Google Play Services. This module is downloaded automatically when an application defines a dependency to com.google.android.gms:play-services-home in the build dependencies.

The easiest way to handle this would be to download Google Home App on your device, and commission a matter device. If you can complete the device setup, you should have a module available on the device. (GHA lists play-services-home as a dependency as well)

You can check which versions of the required components are available on the device by connecting it to your workstation, and going through the following steps on terminal:

  1. Find out the device id of your mobile device by:
adb devices
  1. Save the device id on a local variable, such as:
phoneid=<device_id>
  1. Save the versions for all relevant home components:
containerinfo=$(adb -s $phoneid shell dumpsys package com.google.android.gms | grep "versionName" || true)

homemoduleinfo=$(adb -s $phoneid shell dumpsys activity provider com.google.android.gms.chimera.container.GmsModuleProvider | grep "com.google.android.gms.home" || true)

optionalhomemoduleinfo=$(adb -s $phoneid  shell dumpsys activity provider com.google.android.gms.chimera.container.GmsModuleProvider | grep "com.google.android.gms.optional_home" || true)

policyhomemoduleinfo=$(adb -s $phoneid  shell dumpsys activity provider com.google.android.gms.chimera.container.GmsModuleProvider | grep "com.google.android.gms.policy_home" || true)
  1. Output the saved variables to a file, such as _versions.txt
versionfile=$logtimestamp"_versions.txt"
echo "Saving version info to $versionfile"

echo "Container version:" >> $versionfile
echo $containerinfo >> $versionfile
echo "" >> $versionfile

echo "Home Module version:" >> $versionfile
echo $homemoduleinfo >> $versionfile
echo "" >> $versionfile

echo "Optional Home Module version:" >> $versionfile
echo $optionalhomemoduleinfo >> $versionfile
echo "" >> $versionfile

echo "Policy Home Module version:" >> $versionfile
echo $policyhomemoduleinfo >> $versionfile
echo "" >> $versionfile

Container version is the version of your Google Play Services. Home module is the main module to run the matter functionality. Additionally you should see a version number listed either for Optional Home Module or Policy Home Module, depending how you are getting the packages. These are submodules containing additional functionality, which will be downloaded under the hood alongside the home module.


When these components are missing, you might recieve a com.google.android.gms.common.api.ApiException: 17 exception, which indicates that an API call made to a module within Google Play Services has failed. Sample Apps for Google Home project does have a dependency on specific version of the home components, so please check if the right versions are available on your device.

There is no way to manually trigger a download for these modules, but keeping your phone charged and connected to WiFi might help. On certain OEMs, adding / removing accounts on the device might also invoke a module refresh by the Play Services. But either way, Google Play Services does have a routine that refreshes the module daily, so your phone should download the required modules within 24 hours automatically.