What happened to Google's sideload check documentation?
Asked Answered
C

1

9

When using app bundles, there is a risk that a user will "sideload" a customised APK onto an incompatible device. This may cause a crash, as the required densities / languages won't be present.

To resolve this, there is a handy MissingSplitsManager inside Google Play Core. This shows the user a helpful error on startup instead of crashing. All that needs to be done is adding the following to the application class:

override fun onCreate() {    
    if (MissingSplitsManagerFactory.create(this).disableAppIfMissingRequiredSplits()) {
        return
    }
    super.onCreate()
} 

This check is very easy to implement, and detailed instructions were previously available at https://developer.android.com/guide/app-bundle/sideload-check. There are links to this all over, e.g. in a Realm issue, or at the top of the MissingSplitsManager documentation.

However, this link now redirects to a "Known issues" section, with the very vague:

Partial installs of sideloaded apps—that is, apps that are not installed using the Google Play Store and are missing one or more required split APKs—fail on all Google-certified devices and devices running Android 10 (API level 29) or higher. When downloading your app through the Google Play Store, Google ensures that all required components of the app are installed.

So, what happened? Why is the library's simple check no longer mentioned, even on the documentation for the library.

Perhaps there's some undocumented issue with the library? Perhaps Google don't want to help sideloading at all?

Corked answered 4/3, 2020 at 10:46 Comment(0)
H
8

This library, although convenient, was only a temporary solution until a better solution could be found. This library effectively makes a disk read on every startup of the app, which affects startup latency. Note that this affects all users regardless of whether they have all splits or not, but is only useful for users who sideloaded the app so they'd get a warning message instead of a crash.

The Android platform is now rejecting the installation of apps that don't have all the required splits, rendering the sideloading API unnecessary. This solution should work on all Android versions.

Heurlin answered 10/3, 2020 at 16:38 Comment(5)
By "better solution", are you referring to the "installation failed" dialog that appears on Android 10, that doesn't give any support for reinstalling the app? Just checking we're talking about the same thing.Corked
Correct. The Android platform shouldn't let incomplete apps be installed in the first place which has been fixed, so now developers don't have to jump through hoops (and make their app slower) to avoid getting crashes in their reports. -- I've edited my answer to remove "better solution" as I sense you thought this was controversialHeurlin
@Heurlin but it only works on android 10 right? what about other versions and especially android 4.1 which didn't support MissingSplitsManager in the first placeOsteen
The change was backported to all Android versions via Google Play Protect.Heurlin
@Heurlin the document say's it back ported but We are still able install partial apk's now also. I am trying find a way to detect it as its end up in our crash's dashboardInstitutionalize

© 2022 - 2024 — McMap. All rights reserved.