Android 模拟器 - 创建用户帐户时遇到问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3260868/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 09:19:44  来源:igfitidea点击:

Android Emulator - Trouble creating user accounts

androidandroid-emulator

提问by OceanBlue

I need a user account or two in my Android Emulator so that I can test some texting/mailing function of my app. The trouble is that when I try to do this in the emulator:

我需要在我的 Android 模拟器中有一两个用户帐户,以便我可以测试我的应用程序的一些短信/邮件功能。问题在于,当我尝试在模拟器中执行此操作时:

Settings --> Accounts & sync --> Add account --> (my_gmail_account/password) --> Next

设置 --> 帐户和同步 --> 添加帐户 --> (my_gmail_account/password) --> 下一步

I get the message "Setup could not finish - Unable to open connection to server."

我收到消息“安装无法完成 - 无法打开与服务器的连接。”

My emulator works fine & is able to connect to internet through it's browser. So not sure why it is not working. Has anyone run across this problem?

我的模拟器工作正常并且能够通过它的浏览器连接到互联网。所以不知道为什么它不起作用。有没有人遇到过这个问题?

Thanks!

谢谢!

回答by CharlieMezak

@Varun's solution works for me. There are two things that must be configured correctly: the emulator and your eclipse project.

@Varun 的解决方案对我有用。有两件事必须正确配置:模拟器和您的 eclipse 项目。

To set up the emulator, you'll have to create a new one. Instead of selecting an Android target, select the Google APIs target that you need (this target includes the Android platform, but "Android" doesn't appear in it's title). See screenshot:

要设置模拟器,您必须创建一个新模拟器。不是选择 Android 目标,而是选择您需要的 Google API 目标(此目标包括 Android 平台,但“Android”未出现在其标题中)。看截图:

alt text

替代文字

That emulator should now be able to sign into a gmail account.

该模拟器现在应该能够登录 Gmail 帐户。

To configure your eclipse project, right click the project in the package explorer. Select "Properties" from the dropdown menu. Click "Android" on the left of the properties window, and select the same Google APIs target that you selected for your emulator. See screenshot:

要配置您的 eclipse 项目,请在包资源管理器中右键单击该项目。从下拉菜单中选择“属性”。单击属性窗口左侧的“Android”,然后选择您为模拟器选择的相同 Google API 目标。看截图:

alt text

替代文字

You should also make sure that the correct emulator is selected to run the project. To do this, select "Run/Debug Settings" on the left of the project properties window. Edit the launch settings, and select the appropriate emulator (AVD) under the "Targets" tab.

您还应该确保选择了正确的模拟器来运行项目。为此,请选择项目属性窗口左侧的“运行/调试设置”。编辑启动设置,并在“目标”选项卡下选择适当的模拟器 (AVD)。

This worked for me!

这对我有用!

回答by Piotr Buda

I know this might be looong overdue, but if you're using ICS emulator, you need to push GoogleServicesFramework.apk and GoogleLoginService.apk. After that you can add user accounts.

我知道这可能会过期,但如果您使用 ICS 模拟器,则需要推送 GoogleServicesFramework.apk 和 GoogleLoginService.apk。之后,您可以添加用户帐户。

回答by Nandagopal T

Initially , I too faced the same issue. Done some research and found this link. This is really helpful. Now I can able to add an account in my ICS emulator as well as in my old version emulators too.

最初,我也面临同样的问题。做了一些研究,找到了这个链接。这真的很有帮助。现在我可以在我的 ICS 模拟器以及我的旧版本模拟器中添加一个帐户。

Setting up email account in emulator

在模拟器中设置电子邮件帐户

Cheers.

干杯。