会话“应用程序":安装 APK 时出错 [英] Session 'app': Error Installing APK

查看:32
本文介绍了会话“应用程序":安装 APK 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试按照说明在真实设备上安装应用程序:-

对于旧版本:

打开 Gradle 窗口(在 Android Studio 的右侧)并点击刷新按钮.

然而,这不是 100% 确定的解决方案.

其他情况的解决方案:

打开终端窗口并输入adb kill-server",然后输入adb start-server".通常在几个小时不活动后,adb 用于断开设备连接.(如果您在 PATH 环境变量中没有 sdk/platform-tools,那么您应该在该文件夹中打开一个终端)

如果这些解决方案对您没有帮助,一个提示:如果您打开 Android Studio 右下角的 Event Log 窗口,您可以看到详细的错误消息.

其他边缘情况如果您看到此错误: INSTALL_FAILED_INVALID_APK:... 签名不一致.然后不幸的是 gradle refresh 是不够的,你必须去 Build -> Clean Project 然后再次运行.

Android 模拟器问题如果您想将 APK 部署到 Android 模拟器并且您看到安装 APK 时出错"消息,则您的模拟器可能被冻结并需要重新启动.

Trying to install app on real device following instructions:- http://developer.android.com/tools/device.html. At end Android Studio giving error:

Session 'app': Error Installing APK 

I guess the problem probably can be in my android device(it is chinese Doogee X5). It does not have a given USB Vendor ID in developer docs so I decided to follow instructions with random vendor ID from HTC.

I'm sure there is a way to run application on any android device, but yet I didn't find an answer on how to do that.

I'm running through Linux Ubuntu 14.04 LTS

解决方案

Edit:

In newer Android Studio versions you can re-sync the project using this button:

For older versions:

Open Gradle window (on the right side in Android Studio) and click on the refresh button.

However it is not a 100% sure fix.

Solutions for other cases:

Open terminal window and type "adb kill-server", then type "adb start-server". Usually after a few hours of inactivity, adb used to disconnect the device. (If you don't have the sdk/platform-tools in the PATH environment variable, then you should open a terminal in that folder)

One tip if these solutions don't help you: If you open the Event Log window in the right bottom corner of Android Studio, you can see a detailed error message.

Other edge case If you see this error: INSTALL_FAILED_INVALID_APK:... signatures are inconsistent. Then unfortunately a gradle refresh isn't enough, you have to go to Build -> Clean Project and then Run again.

Issue with Android emulator If you want to deploy the APK to an Android Emulator and you see the "Error installing APK" message, your emulator may be frozen and need restart.

这篇关于会话“应用程序":安装 APK 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆