microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
7.83k stars 1.63k forks source link

Update to v0.2.21.212158 not possible #1510

Open jw243 opened 3 years ago

jw243 commented 3 years ago

Describe the bug The update method described here does not work on my Galaxy Tab S2 8.0.

What can I do to solve the problem?

To Reproduce Steps to reproduce the behavior:

  1. adb shell pm install-create -r --staged
  2. Error message: Unknown option --staged
  3. Tried without option --staged, seemed to work
  4. adb shell pm install-commit session-id
  5. Error message: Failure [INSTALL_FAILED_INVALID_APK: Package com.google.android.gms is a persistent app. Persistent apps are not updateable.]

Expected behavior The update process should work without error messages, which it did on another device of mine (from the same computer via the same version of adb) with Android 11 / LineageOS 17.1 installed.

System Android Version: [9] Custom ROM: [e.g. LineageOS 16.0]

ghost commented 3 years ago

If this doesn't work, you might need to directly update the .apk on your /system-partition or wait for the ROM developer to update to v0.2.21.212158.

token0 commented 3 years ago

Or pack it as Magisk module.

aer0nix commented 3 years ago

Try install as apk.

ghost commented 3 years ago

That specifically isn't possible, for reasons that are explained in the release.

jw243 commented 3 years ago

If this doesn't work, you might need to directly update the .apk on your /system-partition or wait for the ROM developer to update to v0.2.21.212158.

How do I do that?

ghost commented 3 years ago

Do you know which version of the app you have on /system? Did you install updates on top of it already?

It might be possible (and easier) to just uninstall updates and then re-update to 0.2.21, this will lose your microG config though but you might be able to backup and restore afterwards. I'm not entirely sure if you can uninstall updates like that on a persistent system app though.

Otherwise, assuming you can give root permissions to adb (in developer settings), enable USB debugging, give root permissions to adb (Root access --> ADB only), and connect your phone to your pc. Do adb remount to make /system write-enabled, and then adb root to elevate adb to root privileges.

Using Lineage for microG as an example, the apk would be at /system/priv-app/GmsCore/GmsCore.apk, so you would rename the 0.2.21 apk to GmsCore.apk, open command prompt in the directory where you have the apk, and do adb push GmsCore.apk /system/priv-app/GmsCore.

If your setup is different (different rom, or manual install for microG), then you'll have to figure out where the apk is and how the file and folder are named beforehand. Do adb shell, this will place you at the root of your phone's internal memory. Then you can do cd system and cd priv-app to get into priv-app directory, and then ls to figure out microG GmsCore's directory name.

After you're done, you can adb reboot and you should be good.

CapSel commented 3 years ago

I tried replacing apk in priv-app/GmsCore but then all gps/location providers stopped working- IllegalArgumentExeption

ghost commented 3 years ago

Interesting. I don't use those so I wouldn't know for certain, but you might need to clear data for GmsCore and your location providers, and set them back up in microG. I know some weirdness can happen sometimes with the configuration when not cleanly updating (or even downgrading) an app.

token0 commented 3 years ago

I tried replacing apk in priv-app/GmsCore but then all gps/location providers stopped working- IllegalArgumentExeption

Just replacing in /system/priv-app (while /system should be read-only mount point) is bad practice nowadays. Original GmsCore.apk could be a part of GSF/gapps. Best way is to use systemless Magisk module: it works as mount overlay, while original data is kept intact.