简体   繁体   中英

Exported APK works fine. But via USB debugging not working

When I export my Android application as APK and install it in the device it is working properly.

But if I try to launch the same Android application on Device via USB Debugging mode, I'm getting following error:

Installation error: INSTALL_FAILED_VERSION_DOWNGRADE

I'm using Google Play Services , v7 Appcompat with my application as library project.

I've set the Custom Debug Key (the same key which I used while exporting) as explained in this post .

Any suggestion what might be wrong?

Solution 1:

It means you're trying to install an app with the same packageName as an app that's already installed on the emulator, but the one you're trying to install has a lower versionCode .First uninstall your application from the emulator:

adb -e uninstall your.application.package.name

Then try to install the application again or increase the app version and try again.

Solution 2:

May be your package is the same as the default package name. So change and try it.

Solution 3:

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.

Solution 4:

Check your activity class. It may be wrong.

Was answered here . Basically your new version, that you try to install via debugging has a lower version number, than the version, that's already on your phone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM