Visual Studio Android 模拟器没有互联网连接 [英] No internet connection for Visual Studio Android Emulator

查看:76
本文介绍了Visual Studio Android 模拟器没有互联网连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Visual Studio 2015 附带的 Android Emulator.当我运行它时,在 Android 的 Wi-Fi 设置中,此状态显示为 Obtaining IP Address.. for Wired eth1网络.但是时间长了就失效了.

I'm using Android Emulator that comes with Visual Studio 2015. When I run it, in Wi-Fi settings of Android this status appears Obtaining IP Address.. for Wired eth1 network. But it fails after a long time.

  • 在运行模拟器之前移除了Hyper-VVirtual Switch Manager中的所有virtual switch.
  • 代理设置中未选中自动检测设置
  • 尝试了不同的 API 级别(19,22,..)
  • Windows Phone Emulator 没有这个问题,并且有互联网连接.
  • 重新启动我的电脑!

当我诊断出 vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch) 时,它说它的 IP 地址无效.同样在 android 模拟器中,它会尝试获取 IP.显然我需要给模拟器一个有效的IP,但我不知道如何或在哪里或什么价值.

When I diagnose vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch) it says it has an invalid IP address. Also inside android emulator it tries to obtain an IP. Obviously I need to give the emulator a valid IP, but I don't know how or where or what value.

如何让安卓模拟器上网?提前致谢.

How to give the Android emulator internet access? Thanks in advance.

推荐答案

Android 似乎无法从 DHCP 获取 IP 地址.

It looks like Android is unable to acquire an IP address from DHCP.

Hyper-V 管理器 (virtmgmt.msc) 中,为您尝试启动的模拟器配置文件选择 VM,然后转到其 Settings...(右键单击上下文菜单或查看右侧的操作窗格).

In Hyper-V Manager (virtmgmt.msc), select the VM for the emulator profile you are trying to start and go to its Settings... (right click for context menu or see action pane on right side).

Hardware下,确保有两个虚拟交换机:

Under Hardware, make sure there are two virtual switches:

  1. 模拟器内部网络适配器
  2. 模拟器外部网络适配器

Emulator External Network Adapter 必须列为第二个适配器——顺序很重要.如果它们的顺序不正确,请删除外部适配器并重新创建它,并为其提供与以前相同的设置.您可以通过单击 VM 硬件列表中的 Add Hardware 来创建它.

Emulator External Network Adapter must be listed as the second adapter -- the order matters. If they are ordered incorrectly, delete the External adapter and recreate it, giving it the same settings it had before. You can create it by clicking Add Hardware in the VM's hardware list.

这篇关于Visual Studio Android 模拟器没有互联网连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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