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?