android导入项目模拟器运行不了,无法运行Android模拟器(Unable to run Android Emulator)...

编程知识 更新时间:2023-04-17 19:06:01

无法运行Android模拟器(Unable to run Android Emulator)

我在Visual Studio 2013中有一个Xamarin.Forms项目,当我尝试运行我的Android应用程序时,模拟器会加载,但是它不会加载应用程序,并且会发生不同的错误。

当我尝试运行Android模拟器时,取决于我选择的设置,它会弹出

DWP handshake failed

或者在它显示的调试输出中

Couldn't connect to logcat, GetProcessId returned: 0

我发现的所有现有解决方案迄今尚未开展工作,尽管他们过去曾工作过。

I have a Xamarin.Forms project in Visual Studio 2013 and when I try to run my Android application the emulator loads but then it doesn't load the app and different errors will occur.

When I try to run the Android Emulator depending on what settings I chosen it either pops up with

DWP handshake failed

or in the debug output it shows

Couldn't connect to logcat, GetProcessId returned: 0

All existing solutions I have found haven't worked so far, even though they have worked in the past.

原文:https://stackoverflow/questions/27790785

更新时间:2019-11-04 09:15

最满意答案

我只想列举我为解决这个问题所做的所有事情,因为它发生在我身上几次,每次都有不同的原因。

发布然后调试

有时你需要首先在释放模式下将其运行到仿真器,然后才能切换回调试模式并且它可以正常工作。

快速部署

转到Android项目中的属性

转到Android选项

关闭快速部署

如果这不起作用,你也可以试试

关闭共享运行时

链接器设置为不链接

检查你的日志

打开Android设备日志记录,连接到您的模拟器,看看有什么消息回来。

对我来说,我看到了一个内存不足的例外。 模拟器只有323 MB的内存设置。 打开仿真器管理器(设备记录旁边的图标),然后编辑仿真器。 将内存增加到512 MB(这对我来说是这样做的),并且它全部重新开始工作。

I just wanted to list here all the things I have done to resolve this issue since it has happened to me a few times, with different reasons each time.

Release then Debug

Sometimes you need to run it in Release mode first to the emulator, then you can switch back to Debug mode and it works.

Fast Deployment

Go to the properties in your Android Project

Go to Android Options

Turn off Fast Deployment

If that doesn't work, you can also try

Turning off Shared Runtime

Settings the Linker to Don't Link

Check your logs

Open up the Android Device Logging, connect to your emulator and see what messages are coming back.

For me I saw an Out of Memory Exception. The emulator only had 323 MB of memory set for it. Open the emulator manager (the icon next to the device logging) and then edit your emulator. Increase the memory to 512 MB (that did it for me), and it all started working again.

If this doesn't resolve your error, more scenarios are updated at Debugging Xamarin Android Build and Deployment Errors.

2017-02-08

相关问答

我只想列举我为解决这个问题所做的所有事情,因为它发生在我身上几次,每次都有不同的原因。 发布然后调试 有时你需要首先在释放模式下将其运行到仿真器,然后才能切换回调试模式并且它可以正常工作。 快速部署 转到Android项目中的属性 转到Android选项 关闭快速部署 如果这不起作用,你也可以试试 关闭共享运行时 链接器设置为不链接 检查你的日志 打开Android设备日志记录,连接到您的模拟器,看看有什么消息回来。 对我来说,我看到了一个内存不足的例外。 模拟器只有323 MB的内存设置。 打开

...

这个问题是因为你没有创建设备。 所以你必须先在android sdk中创建设备。 为了创建Android设备,您必须先安装avd。 我有一些截图希望帮助你。 像这样准备你的Android API : 然后转到工具 - >管理avds: 在我的情况下,我已经创建了2个设备。 去创建: 然后添加规范,说明您想要哪种设备是虚拟的,以便您理解: 点击确定,您的设备将被创建。 然后再运行你的应用程序。 谢谢。 This problem is because of you didn't created dev

...

尝试将整个onResume()的内容移动到onCreate()方法。 始终在onCreate()中进行UI设置。 阅读本文: 活动生命周期管理 。 并进一步查询stackoverflow :) 干杯! Try moving the contents of your entire onResume() to an onCreate() method. Always do the UI setup in onCreate(). Read this: Activity Lifecycle Managem

...

在AS的最新canary版本中,这被称为“快速启动”。 请参阅https://developer.android/studio/preview/emulator.html In the latest canary build of AS this is called 'quick boot'. See https://developer.android/studio/preview/emulator.html

假设您已经运行了Emulator,请按照以下步骤操作: 在您的Android SDK folde中找到您的adb.exe文件。在Windows环境中,您的adb.exe通常位于[Android-SDK-folder] / platform-tools /中 。 在我的情况下, adb.exe位于C:\ android-juno \ android-sdk \ platform-tools中 。 把它放在你的[Android-SDK-folder] / platform-tools /里面 ,如下图

...

使用Matrix插件是一个很好的解决方案,正如模拟器插件的wiki页面所讨论的那样。 这使您可以使用单个Jenkins作业,在其中定义所需的各种配置组合 - 然后Jenkins将运行一系列子作业来实现每个组合,从而创建所需的Android模拟器配置。 Using the Matrix plugin is a good solution for this, as discussed on the wiki page for the emulator plugin. This lets you hav

...

您只需打开Android虚拟设备管理器并下载最新的模拟器即可。 然后再次运行您的应用程序。它将工作。 You just need to open your Android Virtual Device Manager and download the latest emulator. Then run your application again.It will work.

最简单的方法是将项目源导入为Eclipse项目,然后从Eclipse运行。 Simplest way is to import the project sources as an Eclipse project and then run from Eclipse.

您正在使用Java7。 我怀疑Android应用程序版本是否适用它。 降级到Java 6并尝试将其作为第一步。 You are using Java7. I doubt that the Android app build works with it yet. Downgrade to Java 6 and try that as a first step.

是的,你可以在模拟器中运行apk。 为此,你需要安装apk模拟器.. 步骤在APK中安装APK 打开命令提示符 现在转到工具或平台工具。 EX(E:\ Android的SDK \ TOOLS) 然后输入这个命令adb install [apk文件名,只要它存储] Yes you can run apk in the emulator . for that you need to install apk in emulator .. Steps To Install APK in Emulator

...

更多推荐

android导入项目模拟器运行不了,无法运行Android模拟器(Unable to run Android Emulator)...

本文发布于:2023-04-14 03:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/5d98958018bc75317b1dd77b4d26c127.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模拟器   项目   android   Android   Emulator

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 74451文章数
  • 14阅读数
  • 0评论数