mendhak / gpslogger

:satellite: Lightweight GPS Logging Application For Android.
https://gpslogger.app
Other
1.99k stars 609 forks source link

"Package installer keeps stopping": can't install on new Pixel 8 #1112

Closed NelsonMinar closed 7 months ago

NelsonMinar commented 11 months ago

Thank you for GPSLogger, it's a great tool. I just got a new phone and am unable to install the app. Trying to install results in nothing happening after clicking "install" to run the APK, the install dialog just closes but nothing is installed. If I try several times in quick succession I get a popup "Package installer keeps stopping".

I've tried installing several versions: 129 on GitHub via sideload (from Chrome), 127, 128 and 129 on F-Droid via their installer, the 129 on F-Droid via a sideload. All fail the same way. I can install other apps no problem both with sideloading and F-Droid. I also have GPSLogger 129 installed on my old phone no problem. I was able to browse the GPSLogger APK in Solid Explorer and it looks like a plausible zip archive for a program.

The phone I can't install on is a new Pixel 8 running latest Android 14. I set the phone up with a restore from an old phone that had GPSLogger on it, but the GPSLogger app didn't get installed with the phone setup (no surprise.) I don't know if the phone migration stuff could have picked up some old state or config from GPSLogger on the old phone but it seems unlikely.

I've tried resetting Package Installer, clearing caches and rebooting. No joy.

There's no visible feedback on why the package installer keeps crashing so I'm not sure how to debug this further.

NelsonMinar commented 11 months ago

In some sort of Christmas miracle I was able to install GPSLogger today. I didn't change anything in particular. I did run the installer this time from Google's Files app, instead of F-Droid or Solid Explorer. I don't think that should make a difference (F-Droid has installed other apps just fine) but I didn't test further.

Sorry to take up your time. Will close this but maybe the notes will help someone else with a similar problem in the future.

ohhai commented 8 months ago

@NelsonMinar it isn't just your issue: seems like the build from F-Droid can't be installed at Android 14. My Pixel 7a has same problem. So it's worth reopening, I think (thank you for keeping).

NelsonMinar commented 8 months ago

FWIW 129 has been running on my Android 14 phone OK since I managed to get it to install. At least mostly, it might have been stopped once or twice, I'm having other troubles with battery saving and background processing on this new phone.

When I visit the F-Droid store in the app I see a note "This app was built for an older version of Android and cannot be updated automatically."

On a quick glance I don't see an open GitHub issue about GPSLogger and Android 14. If it's known to be a problem it'd be nice to have a new ticket for that.

mendhak commented 8 months ago

I've reopened (but not investigated yet), I will try to install from F-Droid store and see what happens. I have a Pixel 6 with Android 14

mendhak commented 8 months ago

I can't install from the F-Droid app at all. I managed to find a few other links with a similar issue, pointing at a bug in Android 14, but that's supposed to have been resolved.

https://android.stackexchange.com/questions/256015/package-installer-crashes-when-installing-certain-apps-java-lang-runtimeexcept

https://github.com/uazo/cromite/issues/595

https://github.com/Catfriend1/syncthing-android/issues/1075

https://github.com/Razeeman/Android-SimpleTimeTracker/issues/144

Tracked to here: https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/jni/Bitmap.cpp;l=883?q=Bitmap_writeToParcel&ss=android%2Fplatform%2Fsuperproject%2Fmain

Android Tracker issue link: https://issuetracker.google.com/issues/303849830

Stacktrace, I got this running logcat and saw this happen whenever I clicked Install in the F-Droid app.

FATAL EXCEPTION: main
Process: com.google.android.packageinstaller, PID: 17427
java.lang.RuntimeException: Could not copy bitmap to parcel blob.
    at android.graphics.Bitmap.nativeWriteToParcel(Native Method)
    at android.graphics.Bitmap.writeToParcel(Bitmap.java:2271)
    at android.os.Parcel.writeParcelable(Parcel.java:2584)
    at com.android.packageinstaller.PackageUtil$AppSnippet.writeToParcel(PackageUtil.java:151)
    at android.os.Parcel.writeParcelable(Parcel.java:2584)
    at android.os.Parcel.writeValue(Parcel.java:2485)
    at android.os.Parcel.writeValue(Parcel.java:2362)
    at android.os.Parcel.writeArrayMapInternal(Parcel.java:1298)
    at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1843)
    at android.os.Bundle.writeToParcel(Bundle.java:1389)
    at android.os.Parcel.writeBundle(Parcel.java:1367)
    at android.content.Intent.writeToParcel(Intent.java:11807)
    at android.os.Parcel.writeTypedObject(Parcel.java:2203)
    at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2077)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1873)
    at android.app.Activity.startActivityForResult(Activity.java:5615)
    at android.app.Activity.startActivityForResult(Activity.java:5573)
    at android.app.Activity.startActivity(Activity.java:6071)
    at android.app.Activity.startActivity(Activity.java:6038)
    at com.android.packageinstaller.PackageInstallerActivity.startInstall(PackageInstallerActivity.java:701)
    at com.android.packageinstaller.PackageInstallerActivity.lambda$bindUi$0(PackageInstallerActivity.java:479)
    at com.android.packageinstaller.PackageInstallerActivity.$r8$lambda$RCIm8wl1VPqdfQgkgmrBIDbuvOQ(PackageInstallerActivity.java:0)
    at com.android.packageinstaller.PackageInstallerActivity$$ExternalSyntheticLambda0.onClick(R8$$SyntheticClass:0)
    at com.android.packageinstaller.AlertController$ButtonHandler.handleMessage(AlertController.java:144)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8248)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

But not clear to me what a workaround fix is. Is it something related to the monochrome icons?

NelsonMinar commented 8 months ago

Glad you can reproduce the problem! I still don't know why it worked for me magically after several times it did not.

The monochrome icon comment makes me want to mention I'm using the Niagara Launcher with its built-in monochrome icon replacements ("Anycons", which get colored by Material You). I previously was using the Pix Material You icon pack. I'd like to think the launcher's icons wouldn't affect the installer and I've had no issues with other apps. But since you mentioned icons...

mendhak commented 8 months ago

Through ~hours of random guesswork~ a highly rigorous and scientific process, I have reduced this icon's size and this change works. I'll include it in Milestone 130.

https://github.com/mendhak/gpslogger/commit/43276a074778678549a94e01f99dca3cfec25d6d

mendhak commented 7 months ago

v130 is now on FDroid and the releases.

NelsonMinar commented 7 months ago

I verified the fix. I just reinstalled v130 from F-Droid on my Pixel 8, Android 14. No problems. Thanks for figuring this out and fixing it.

F-Droid is still complaining on the app page "This app was built for an older version of Android and cannot be updated automatically" but that doesn't stop the install from working. Presumably you know all about that already.

mendhak commented 7 months ago

I don't know why it's appearing, I think that warning is because I have a low minSdk. I see this thread on the FDroid forums which talks about something similar :

https://forum.f-droid.org/t/play-protect-saying-old-version-of-apk-does-not-contain-latest-privacy-security-in-fdroid-apk/20391/25

If that is the reason it'll keep appearing for a long time. I try to keep backward compatibility with old devices, until some Android upgrades force a higher minimum.

NelsonMinar commented 7 months ago

What worries me here is the "cannot be updated automatically part". I'll see how bad it is when the next version comes out and open a new issue if it makes upgrading too difficult.

commonsguy commented 4 months ago

FWIW, I just ran into this problem, where the 131-rc2 app cannot be installed from F-droid. Logcat shows install aborted with errorMessage: Failed to install due to an unknown error from F-droid but nothing obvious about what is stopping it from being installed. Installing 130 worked just fine, and updating from 130 to 131-rc2 also worked just fine. 🤷🏻