How to solve install status code -100 while working with In-App update in Android?

谁说胖子不能爱 提交于 2020-01-05 04:09:13

问题


I'm working with In-App update from here: https://developer.android.com/guide/app-bundle/in-app-updates

I have successfully implemented it in my app. My app is already in playstore: https://play.google.com/store/apps/details?id=com.tekitsolution.remindly

for Testing this implementation, I decreased version in my project and I implemented in Splash Activity.

So, I got the update screen, I click on update and it started downloading. After completing the download, it is again coming same page to download and installErrorCode is getting -100 which means An internal error happened in the Play Store. (Is there a way to understand what install error codes actually mean?)

Flow from update screen:
I printed logs for `state.installStatus()`
PENDING = 1;
DOWNLOADING = 2;
DOWNLOADED = 11;
INSTALLING = 3;

then instead of this (INSTALLED = 4), I'm getting FAILED = 5 with state.installErrorCode -100

Code:

private InstallStateUpdatedListener installStateUpdatedListener = new
                        InstallStateUpdatedListener() {
                            @Override
                            public void onStateUpdate(InstallState state) {
                                showLog("In-App: " + state.installStatus());
                                showLog("installErrorCode " + state.installErrorCode());
                                if (state.installStatus() == InstallStatus.DOWNLOADED) {
                                    popupSnackbarForCompleteUpdate();
                                } else if (state.installStatus() == InstallStatus.INSTALLED) {
                                    if (mAppUpdateManager != null) {
                                        showLog("In-App: unregisterListener");
                                        mAppUpdateManager.unregisterListener(installStateUpdatedListener);}

                                }
                            }
                        };

Note: I tried with different devices also.

来源:https://stackoverflow.com/questions/58517654/how-to-solve-install-status-code-100-while-working-with-in-app-update-in-androi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!