android 10 app版本降级时提示未安装应用怎么解决?

现在又app1.0 2.0 两个版本 ,代码区别仅仅是 versionCode 和versionName 不一致; apk包皆为release 版本

第一步:手机安装1.0 版本;然后后台更新到2.0版本,手机打开app会自动下载2.0包更新,安装成功。
第二步:后台将app版本改为1.0;打开app(现在app版本是2.0)会自动下载1.0包更新 但是在安装时会提示 未安装应用

// 安装apk部分代码
private void installApk() {
    File apkfile = mUpdateInfo.apkFile();
    if (!apkfile.exists()) {
        stopSelf();
        return;
    }

    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    if (Build.VERSION.SDK_INT >= 24) {
        intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
        Uri contentUri = FileProvider.getUriForFile(this, BuildConfig.APPLICATION_ID + ".fileProvider", apkfile);
        intent.setDataAndType(contentUri, "application/vnd.android.package-archive");
    } else {
        intent.setDataAndType(Uri.fromFile(apkfile), "application/vnd.android.package-archive");
    }
    startActivity(intent);
    //弹出安装窗口把原程序关闭。
    //避免安装完毕点击打开时没反应 android 10 不能关闭
   // android.os.Process.killProcess(android.os.Process.myPid()) ;
    stopSelf();
}

<?xml version="1.0" encoding="utf-8"?>
<paths>
    <!-- . 代表全路径-->
    <external-path path="." name="external_storage_root" />
</paths>

请问这个问题怎么解决

更新版本比安装版本低,有些手机会提示卸载高版本重新安装,有些手机就直接拒绝安装了

只能升级不能降级,如果要更新还原,就拿旧版本代码内容,然后把版本改成下一个版本

正常安装方法无法降级安装,想降级安装要么卸载原app,重新安装,要么使用命令强制安装