简体   繁体   English

导出的APK工作正常。 但是通过USB调试无法正常工作

[英]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. 可能是错误的。

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. 基本上,您尝试通过调试安装的新版本的版本号比手机上已有的版本号低。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android Studio在同一部手机上运行应用程序时生成的APK崩溃正常。 怎么了? - Android Studio generated APK crashes while running the application on the same phone works fine. What is wrong? 无法将应用程序安装为.apk,但是我可以通过USB调试安装它 - Can't install app as .apk, but I can install it via USB-debugging 通过设备运行USB调试时,UI会失真,但在AVD上可以正常工作 - My UI gets distorted when I run it through my device(USB debugging) but works fine on my AVD 应用程序在 USB 调试模式下工作正常,但是当我生成签名 APK 并安装它时,它不起作用 - App is working fine in usb debug mode, but when i generate Signed APK and install it, its not working 如果没有 @Repository 注释,代码可以正常工作,而使用注释也可以正常工作。 有什么区别? - Without @Repository annotation the code works fine and with annotation also works fine. What is the difference? wget正常工作时,通过代理的Java HttpsURLConnection无法正常工作 - Java HttpsURLConnection via Proxy not working while wget works fine VirtualWebAppLoader可以正常工作。 但是当包含在tomcat / lib /中时,同一组罐子不起作用 - VirtualWebAppLoader works fine. But same set of jars doesnt work when included in tomcat/lib/ 需要重新启动应用程序以显示添加到recyclerView的第一项。 后来一切正常。 - Need to restart the app to show the first item added to recyclerView. Later it all works fine. 可运行的Jar文件不起作用,但是源代码可以正常工作。 Maven项目JavaFX - Runnable Jar file doesn't work but the source code works fine. Maven Project JavaFX JAX-RS休息服务运行正常。 如何添加JSP页面? 卡住配置 - JAX-RS rest services working fine. How to add JSP pages? Stuck with configuration
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM