简体   繁体   English

Android错误安装APK

[英]Android Error Installing APK

When I try to run my app in an emulator I get the error: 当我尝试在模拟器中运行我的应用程序时,出现错误:

The APK file C:\Users\PC\AndroidStudioProjects\AppProject\app\build\outputs\apk\app-debug.apk does not exist on disk.
Error while Installing APK

I'm not entirely sure what has happened after I just recieved an update for android studio. 我不完全确定刚收到android studio更新后发生了什么。 I have tried refreshing the gradle projects, cleaning the project, rebuilding the project, building the apk file, and of course restarting android studio. 我尝试刷新gradle项目,清理项目,重建项目,构建apk文件,当然还要重新启动android studio。 I can build the apk and it shows up in my file explorer, but when I try to run it gives me this error as if android studio is not finding it. 我可以构建apk,它显示在我的文件资源管理器中,但是当我尝试运行它时,却出现了这个错误,好像android studio找不到它一样。 Can anyone help me or lead me in the right direction to fix the problem? 谁能帮助我或引导我朝正确的方向解决问题?

Hey its to do with the Gradle version when running the application. 嘿,与运行应用程序时的Gradle版本有关。 For some reason its not installing the debugger. 由于某种原因,它没有安装调试器。 Just use the version 2.1.3 instead of 2.2.0 and it will work or you can go to File -> Project Structure -> Project -> Android Plugin Version. 只需使用版本2.1.3而不是版本2.2.0,它将起作用,或者您可以转到文件->项目结构->项目-> Android插件版本。 change to 2.1.3 更改为2.1.3

Reference this image if your stuck. 如果卡住,请参考此图像。

This error can sometimes be caused by issues in your ports. 有时,此错误可能是由端口中的问题引起的。 You need to follow these steps to fix this. 您需要按照以下步骤解决此问题。

  1. Go to task manager and kill the service named "adb.exe". 转到任务管理器,并杀死名为“ adb.exe”的服务。

  2. If you are using a personal computer , then try switching between your front and back ports. 如果您使用的是个人计算机,请尝试在前后端口之间切换。

  3. If you are using a laptop, then try switching between your available ports. 如果您使用的是笔记本电脑,请尝试在可用端口之间切换。

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

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