我有一个程序在Android模拟器工作。我不时地创建一个签名的。apk,并将其导出到我的HTC Desire进行测试。一切都很好。

在我最新导出的。apk上,当我试图安装。apk时,我得到错误消息“应用程序未安装”。它在模拟器上运行良好。

因为我主要是在模拟器上测试,只是时不时地导出到真正的手机上,我不确定这是什么时候发生的。什么可能的原因,它不安装在物理手机,但运行良好的模拟器?

我已经尝试重新启动电话并删除现有的。apk,并不能解决这个问题。


当前回答

我也遇到了同样的问题,下面是解决方法:转到Manifest文件,确保你有“Debuggable”和“Test Only”属性设置为false。这对我很有用:)

其他回答

我也有同样的问题。我不知道即使是测试,应用程序也必须签名。

自签名后,它安装好了。

I had a similar situation.I was able to install app in debug mode using USB but not a signed version. I was able to install signed version on other phone, but not on my device. Numerous reasons and solutions did not help me. But one direction I got from a solution "uninstall for all users". What I did is to again install app in debug mode using USB connection, go to app details and "uninstall for all users" from right top 3 dots - to remove debug version. This looks like cleared all kinds of references. I usually do a normal uninstall.

现在我能够在设备上获得签名APK并成功安装。

我知道这是一个老帖子,但对新用户可能有用。我也遇到了同样的问题:我的应用程序在调试时工作得很好。当我签署APK时,我得到了同样的消息:“应用程序未安装”。

我修复了卸载JDK(我使用的是JDK -6u14-windows-x64)并安装了一个新的JDK (JDK -6u29-windows-x64)。导出并再次签署APK后,一切正常!

恢复,我的问题是在JAVA版本。谢谢的甲骨文! !

使用Android Studio,我之前安装了APK的未签名调试版本(Build > Build APK),在安装有签名的发布版本之前必须卸载它(Build Variant > Build Variant: release, Build > Generate signed APK)。

在我的例子中,这是因为Android Studio 3.0设置Android:testOnly="true"在apk上,从版本build Variant构建。

https://commonsware.com/blog/2017/10/31/android-studio-3p0-flag-test-only.html

所以运行。/gradlew assemblerrelease来解决我的问题