Is there any way to ignore INSTALL_FAILED_VERSION_

2019-01-21 01:09发布

It seems like the most recent Android 4.2 has introduced this error condition on installation when one attempts to install an APK with a lower version. In prior versions of Android, one would be able to install older APK's simply via adb install -r <link to APK>. For debugging purposes, I frequently need to re-test older APK's; and the -r flag would replace the older build in older Android versions. Is there a work-around here to ignore [INSTALL_FAILED_VERSION_DOWNGRADE]?

7条回答
来,给爷笑一个
2楼-- · 2019-01-21 01:27

You can try and use adb uninstall -k <package> and then installing the older apk. From the adb usage guide:

  adb uninstall [-k] <package> - remove this app package from the device
                                 ('-k' means keep the data and cache directories)

I've tried it myself with my apk, and it seems to work for most of the data (some data like RawContacts was not saved)

查看更多
孤傲高冷的网名
3楼-- · 2019-01-21 01:30

Did you enabled Multiple account on your device (and push your apk via ADB)? If so you have to remove the apk in every account. After complete uninstall, your push will be OK.

查看更多
一纸荒年 Trace。
4楼-- · 2019-01-21 01:30

Try uninstalling previously installed version of app using-

adb uninstall com.package.name

and then install/run your app again

查看更多
Root(大扎)
5楼-- · 2019-01-21 01:31

I also faced the same problem.It can be resolved with below steps which are easier than deleting any apk from the device -

1) Run command "adb logcat | grep -i version" on the terminal

2) Look for the particular line, which will be shown at the end of the logcat -

"Downgrade detected: Update version code 5011  is older than current 9109"

3) copy the current version( for eg 9109) and paste it in AndroidManifest.xml as shown below -

android:versionCode="9109"

Now clean and rebuild the application and it should work fine.

查看更多
相关推荐>>
6楼-- · 2019-01-21 01:36

In my case it was a stale version of Google Play Services included with my project. I am using Android Studio. I ran an update on the SDK, and imported the updated library, and that error went away. So my suggestion: update to the latest libraries that are referenced by your project.

查看更多
Juvenile、少年°
7楼-- · 2019-01-21 01:38

You might have installed from a separate copy of the code where the version number was higher than the copy you’re working with right now. In either case, uninstall the currently installed copy, or open up Settings > Apps to determine the version number for the installed app, and increment your versionCode to be higher in the AndroidManifest.

查看更多
登录 后发表回答