[英]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. 当我将
Android
应用程序导出为APK
并将其安装在设备中时,它可以正常工作。
But if I try to launch the same Android
application on Device via USB Debugging mode, I'm getting following error: 但是,如果我尝试通过USB调试模式在设备上启动相同的
Android
应用程序,则会收到以下错误消息:
Installation error: INSTALL_FAILED_VERSION_DOWNGRADE
I'm using Google Play Services
, v7 Appcompat
with my application as library project. 我将
Google Play Services
v7 Appcompat
与我的应用程序一起用作库项目。
I've set the Custom Debug Key
(the same key which I used while exporting) as explained in this post . 我已经设置了
Custom Debug Key
中的说明(这是我在输出中使用相同的密钥) 在这个岗位 。
Any suggestion what might be wrong? 有什么建议可能有什么问题吗?
Solution 1: 解决方案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: 这意味着您正在尝试使用与模拟器上已经安装的应用程序相同的packageName安装一个应用程序,但是您要安装的应用程序具有较低的versionCode。首先从模拟器中卸载您的应用程序:
adb -e uninstall your.application.package.name
Then try to install the application again or increase the app version and try again. 然后尝试再次安装该应用程序或增加该应用程序的版本,然后重试。
Solution 2: 解决方案2:
May be your package is the same as the default package name. 可能是您的软件包与默认软件包名称相同。 So change and try it.
因此,请更改并尝试。
Solution 3: 解决方案3:
Did you enabled Multiple account on your device (and push your apk via ADB)? 您是否在设备上启用了多个帐户(并通过ADB推送了APK)? If so you have to remove the apk in every account.
如果是这样,您必须删除每个帐户中的apk。 After complete uninstall, your push will be OK.
完全卸载后,您的推送将确定。
Solution 4: 解决方案4:
Check your activity class. 检查您的活动课程。 It may be wrong.
可能是错误的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.