简体   繁体   English

Android模拟器 - 无法创建用户帐户

[英]Android Emulator - Trouble creating user accounts

I need a user account or two in my Android Emulator so that I can test some texting/mailing function of my app. 我的Android模拟器中需要一个或两个用户帐户,以便我可以测试我的应用程序的一些短信/邮寄功能。 The trouble is that when I try to do this in the emulator: 麻烦的是,当我尝试在模拟器中执行此操作时:

Settings --> Accounts & sync --> Add account --> (my_gmail_account/password) --> Next 设置 - >帐户和同步 - >添加帐户 - >(my_gmail_account /密码) - >下一步

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! 谢谢!

@Varun's solution works for me. @Varun的解决方案适合我。 There are two things that must be configured correctly: the emulator and your eclipse project. 必须正确配置两件事:模拟器和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). 选择您需要的Google API目标(此目标包括Android平台,但“Android”不会出现在其标题中),而不是选择Android目标。 See screenshot: 看截图:

替代文字

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. 要配置eclipse项目,请右键单击包浏览器中的项目。 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. 点击属性窗口左侧的“Android”,然后选择您为模拟器选择的相同Google API目标。 See screenshot: 看截图:

替代文字

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! 这对我有用!

I know this might be looong overdue, but if you're using ICS emulator, you need to push GoogleServicesFramework.apk and GoogleLoginService.apk. 我知道这可能已经过时了,但如果您使用的是ICS模拟器,则需要推送GoogleServicesFramework.apk和GoogleLoginService.apk。 After that you can add user accounts. 之后,您可以添加用户帐户。

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. 干杯。

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

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