android – Getting error INSUFFICIENT_STORAGE = -10, while installing dynamic feature module for Specific device named Redmi K20 PRO-ThrowExceptions

Exception or error:

I have implemented a dynamic feature module. Base module gets installed successfully but when I request for the dynamic module, it gets downloaded but throws error while installing saying INSUFFICIENT_STORAGE = -10 from PlayCore library even though there is a lot of space(more than 18GB). It runs as smooth as butter for all other users.

@Override
public void onStateUpdate(SplitInstallSessionState splitInstallSessionState) {
    long totalModuleSize = splitInstallSessionState.totalBytesToDownload();
    long downloadedBytes = splitInstallSessionState.bytesDownloaded();

    Log.d(TAG, "onStateUpdate() called with: totalModuleSize = [" + totalModuleSize + "]" + "  :   " +
            "+downloadedBytes = [" + downloadedBytes + "]");


    if (splitInstallSessionState.status() == SplitInstallSessionStatus.REQUIRES_USER_CONFIRMATION) {

        try {
            splitInstallManager.startConfirmationDialogForResult(
                    splitInstallSessionState, this, MY_REQUEST_CODE_UGAM);
        } catch (IntentSender.SendIntentException e) {
            Log.e(TAG, "onStateUpdate: IntentSender.SendIntentException : " + e.getMessage());
        }
    } else if (splitInstallSessionState.status() == SplitInstallSessionStatus.INSTALLING) {
        mCustomProgressDialog.setMessage(getString(R.string.installing_dailog_message_base));
        return;
    } else if (splitInstallSessionState.status() == SplitInstallSessionStatus.INSTALLED) {
        if (mCustomProgressDialog != null && mCustomProgressDialog.isShowing()) {
            mCustomProgressDialog.dismiss();
        }
        performLogin();

    } else if (splitInstallSessionState.status() == SplitInstallSessionStatus.FAILED) {
        if (mCustomProgressDialog != null && mCustomProgressDialog.isShowing()) {
            mCustomProgressDialog.dismiss();
        }
        if (splitInstallSessionState.errorCode() == SplitInstallErrorCode.NETWORK_ERROR) {
            showAlertDialogWithOkBtn(getString(R.string.dynamic_module_download_failed_base_network_err));

        } else if (splitInstallSessionState.errorCode() == SplitInstallErrorCode.INSUFFICIENT_STORAGE) { //  this is true in Redmi K20 PRO
            showAlertDialogWithOkBtn(getString(R.string.dynamic_module_download_failed_base_insufficient_storage));

        } else {
            showAlertDialogWithOkBtn(getString(R.string.dynamic_module_download_failed_base) + " (" + splitInstallSessionState.errorCode() + ")");
        }
    }

    if (totalModuleSize == 0) {
        return;
    }
    final int progress = ((int) (((double) downloadedBytes / (double) totalModuleSize) * 100));

    Log.d(TAG, "onStateUpdate: progress : " + progress);
    mCustomProgressDialog.setMessage(getString(R.string.downloading_dialog_message_base) + String.valueOf(progress) + "%");
}
How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *