I have integrated the in-app updates feature by Google Play Core library using this link.
I am using immediate update option because we make various critical bug fixes regularly which are important to update.
Here are the cases when app doesn't crash and updates app successfully and when it crashes.
- Click 'Update' button when app update is available and let the update to finish properly without interrupting it in between - App Updated successfully.
- Click 'Update' button, update starts to download, but user cancels update in middle by pressing 'x' button present after 'Update Download progress bar' - App Update canceled.
- Try opening app again, it crashes with following error.
Fatal Exception: java.lang.RuntimeException java.lang.reflect.InvocationTargetException com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:586) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:942) Caused by java.lang.reflect.InvocationTargetException java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:942) Caused by android.content.IntentSender$SendIntentException android.app.Activity.startIntentSenderForResultInner (Activity.java:5019) com.google.android.play.core.appupdate.b.startUpdateFlowForResult (Unknown Source:5) co.behtarinternal.app.menu.MenuActivity$checkForAppUpdate$1.onSuccess (MenuActivity.kt:239) co.behtarinternal.app.menu.MenuActivity$checkForAppUpdate$1.onSuccess (MenuActivity.kt:43) com.google.android.play.core.tasks.e.run (Unknown Source:27) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:942)
I have also referred to this question and its answer, but cannot understand how this solution can be implemented.
I have searched a lot everywhere, but didn't find any feasible solution related to this problem.
If any of you out there have faced a similar issue, and your solution worked, do help me.