I am new to Android development and I'm using the Firebase App Distribution tool. It successfully prompts the user when there is a new version available to download, and in the notification drawer it shows the app downloading. However, once the app has finished downloading it crashes and when I check the app version number it hasn't changed.
For reference, I can confirm that the signing certificate is the same in both cases because it is the identical build process for both versions.
Also here is my current onResume() method, which is mostly just segments of code copied and patched together from the documentation, but with toasts for status checking (because I haven't figured out yet how to configure the debugger when distributing the app via Firebase App Distribution)
override fun onResume() {
super.onResume()
val firebaseAppDistribution = FirebaseAppDistribution.getInstance()
val userSignedInText = if (firebaseAppDistribution.isTesterSignedIn) "User is signed in" else "User is not signed in"
Toast.makeText(this, userSignedInText, Toast.LENGTH_SHORT).show()
if (firebaseAppDistribution.isTesterSignedIn) {
firebaseAppDistribution.updateIfNewReleaseAvailable()
.addOnProgressListener { updateProgress ->
// (Optional) Implement custom progress updates in addition to
// automatic NotificationManager updates.
Toast.makeText(this, "updateProgressIsHappening", Toast.LENGTH_SHORT).show()
}
.addOnFailureListener { e ->
Toast.makeText(this, "failureIsHappening", Toast.LENGTH_SHORT).show()
// (Optional) Handle errors.
if (e is FirebaseAppDistributionException) {
when (e.errorCode) {
FirebaseAppDistributionException.Status.NOT_IMPLEMENTED -> {
Toast.makeText(this, "SDK did nothing. This is expected when building for Play.", Toast.LENGTH_LONG).show()
}
else -> {
Toast.makeText(this, e.message, Toast.LENGTH_LONG).show()
}
}
}
}
}
}
It seems like this is a problem with the theme (although it's not clear to me why, and I will happily accept an answer that more clearly justifies why)
Updating the theme from:
<style name="Theme.Spontaneous_Connection" parent="android:Theme.Material.Light.NoActionBar" />
To:
<style name="Theme.Spontaneous_Connection" parent="Theme.Material3.DayNight.NoActionBar" />
And adding the following dependencies:
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("com.google.android.material:material:1.12.0")
Allows the app to download and then install as expected.