Expo dev client 无法连接到开发服务器。

huangapple go评论54阅读模式
英文:

Expo dev client cannot connect to the dev server

问题

开发构建使用expo-dev-client和Expo应用程序服务似乎在连接到开发服务器时遇到了问题。

在运行npx expo start --dev-client之后,开发客户端应用程序停留在启动画面上。JavaScript捆绑过程也没有启动。

过一段时间后,我在应用程序上看到了错误屏幕,显示它的请求连接到开发客户端超时。

可能的原因是什么?

英文:

A development build that uses expo-dev-client and Expo Application Service seems to be having trouble connecting to the dev server.

The dev client app hangs on the splash screen after running npx expo start --dev-client. The JavaScript bundle process also doesn't start.

After a while, I get the error screen on the app saying that its request to connect to the dev client timed out.

There was a problem loading the project.

This development build encountered the following error:

Failed to load app from http://172.20.1.160:8081
with error: The request timed out.

What might be the reason?

答案1

得分: 2

"Adding --tunnel to the expo start command solved the issue.

npx expo start --dev-client --tunnel

更多关于“隧道连接”的信息,请参阅此 expo-cli 文档页面。"

英文:

Adding --tunnel to the expo start comment solved the issue.

npx expo start --dev-client --tunnel

More information on "tunneling" at this expo-cli doc page.

答案2

得分: 0

expo sdk 49

eas build --profile development-simulator --platform ios

iOS模拟器构建,安装到模拟器上,然后运行

npx expo start --dev-client
英文:

expo sdk 49

eas build --profile development-simulator --platform ios

iOS simulator build install on simulator then run

npx expo start --dev-client

huangapple
  • 本文由 发表于 2023年5月15日 13:02:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/76250987.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定