简体   繁体   English

无法使用 react-native 应用程序在 android 模拟器上登录 Google 帐户

[英]Could not sign in Google account on android emulator with react-native app

I have react-native app, and it works thru Google account.我有 react-native 应用程序,它可以通过 Google 帐户运行。 And when i launch my app on android emulator i can not sign in Google account.当我在 android 模拟器上启动我的应用程序时,我无法登录 Google 帐户。 Get an error: "There was a problem communicating with Google servers. Try again later".收到错误:“与 Google 服务器通信时出现问题。请稍后再试”。 My steps to reproduction:我的繁殖步骤:

  • Reinstalled app and android emulator.重新安装应用程序和 android 仿真器。
  • Cleaned app and emulator cache.清理应用程序和模拟器缓存。
  • Checked different emulators model with different API.检查了不同的仿真器 model 和不同的 API。
  • Tried to sign in Google account in android emulator from google chrome, from Settings => Accounts => Add Account => Google.试图从谷歌浏览器的 android 模拟器中登录谷歌账户,从设置 => 账户 => 添加账户 => 谷歌。

And all this steps is not working for me.所有这些步骤都不适合我。 Every time the same situation: the process of loading, spinner is launching about a minute, and after get an error: "Could not sign in".每次都是同样的情况:加载过程中,spinner 启动了大约一分钟,之后报错:“Could not sign in”。 Can somebody help me please.有人可以帮我吗。

在此处输入图像描述

i have found the decision.我找到了决定。 The deal is my emulator was not connected to internet.交易是我的模拟器没有连接到互联网。 My step was:我的步骤是:

  1. Check environment emulator path and make sure it is like this - MacOS: ~/Library/Android/sdk/emulator, Windows: C:\Users%Username%\AppData\Local\Android\sdk\emulator.检查环境模拟器路径并确保它是这样的 - MacOS: ~/Library/Android/sdk/emulator, Windows: C:\Users%Username%\AppData\Local\Android\sdk\emulator。
  2. Check your available emulators list: emulator -list-avds.检查您可用的模拟器列表:emulator -list-avds。
  3. Run your available emulator with dns server set to 8.8.8.8: emulator @{YourEmulator} -dns-server 8.8.8.8.在 dns 服务器设置为 8.8.8.8 的情况下运行可用的模拟器:emulator @{YourEmulator} -dns-server 8.8.8.8。 And after you can get access to Google from your android emulator.在您可以从 android 仿真器访问 Google 之后。

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

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