Android_Install 版本降级失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24547924/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:23:58  来源:igfitidea点击:

Android_Install failed version downgrade

androidversionupgradegoogle-playdowngrade

提问by user3503072

I'm going to update my apk on GooglePlayStore and I know that i have to upgrade the version code and name in manifest file however, it made install_failed.

我将在GooglePlayStore上更新我的 apk ,我知道我必须升级清单文件中的版本代码和名称,但是它导致 install_failed。

Installation error: INSTALL_FAILED_VERSION_DOWNGRADE 

Please check logcat output for more details. Launch canceled!

请检查 logcat 输出以获取更多详细信息。发射取消!

I modified the version code and name like this: android:versionCode="2" android:versionName="1.0.5"

我像这样修改了版本代码和名称:android:versionCode="2" android:versionName="1.0.5"

Did i make it wrong?

我做错了吗?

回答by Martin

Just uninstall the application on your device first and then install the fresh one.

只需先卸载设备上的应用程序,然后安装新的应用程序即可。

回答by kemuri

When you are installing via adbyou can pass -dto allow version downgrade

当您通过安装时,adb您可以通过-d以允许版本降级

adb install -d -r your.apk

-rwill also replace the existing app

-r还将替换现有的应用程序

回答by Satyapira Pradhan

Installation error: INSTALL_FAILED_VERSION_DOWNGRADE Please check logcat output for more details. Launch canceled!

I solved it by using the command prompt,navigating to project folder >adb uninstall package (you can get the package from Manifest.xml file).

我通过使用命令提示符解决了它,导航到项目文件夹 >adb 卸载包(您可以从 Manifest.xml 文件中获取该包)。

In my case : D:\projectFolder\AndriodApp>adb uninstall com.example.app

就我而言:D:\projectFolder\AndriodApp>adb uninstall com.example.app

Again launch the App in emulator or mobile.

再次在模拟器或移动设备中启动应用程序。

回答by Karl Lu

just use this:

只需使用这个:

$ adb -e uninstall your.application.package.name

$ adb -e uninstall your.application.package.name

回答by keyboardsurfer

Apparently the versionCodeof your currently installed version of the application is greater than 2, thus resulting in a failed installation on the device.

显然versionCode,您当前安装的应用程序版本大于 2,从而导致在设备上安装失败。

回答by Yusuf

This happen when your installed apk version less than version by which you are trying to build apk. For example you just upgrade your version and try to build apk with it but you already a installed apk in your device which was build by the previous one.

当您安装的 apk 版本低于您尝试构建 apk 的版本时,就会发生这种情况。例如,您只是升级您的版本并尝试用它构建 apk,但您的设备中已经安装了一个由前一个构建的 apk。

In this case you must uninstall the previous apk and build a new one with the exiting version.

在这种情况下,您必须卸载以前的 apk 并使用现有版本构建一个新的 apk。

回答by Jose Flores

I just disabled it first in setting>apps>allapps>app and I was able to install using regular command: adb -r name.apk

我只是在设置>应用程序>所有应用程序>应用程序中首先禁用它,我能够使用常规命令进行安装:adb -r name.apk

回答by Ajay Takur

First thing you need to do is check versionCode and versionName for palystore apk and then increment number by one for both versionCode and versionName.

您需要做的第一件事是检查 palystore apk 的 versionCode 和 versionName,然后将 versionCode 和 versionName 的数字加一。

for instance:in playstore versionCode="42"and versionName="1.4.2"then change it versionCode="43"and versionName="1.4.3"in your latest code

例如:在Play商店中 versionCode="42"versionName="1.4.2",然后改变它versionCode="43",并versionName="1.4.3"在最新的代码

回答by Atul Panda

Ajay Takur is correct. Your App's current version code should be greater than the playstore one.

阿杰·塔库尔是对的。您的应用程序的当前版本代码应大于 Playstore 版本代码。

But do refer to thisanswer once. It may solve your problem.

但是请参考答案一次。它可能会解决您的问题。

回答by Krishna Vedula

In my case, I had to remove and uninstall the version on the device and then running the project. It reinstalled the version in the IDE and it worked like a charm.

就我而言,我必须删除并卸载设备上的版本,然后运行该项目。它在 IDE 中重新安装了该版本,并且效果很好。