[英]Expo stuck on endless loading screen when trying to start app on real phone
I recently set up a new react native project, which I test on my phone using expo.我最近建立了一个新的 React Native 项目,我使用 expo 在我的手机上进行了测试。
It worked fine in the beginning, I could start the app on my phone without problems using the QR code from expo. However after some time it stopped working, when I now try to load the app on my phone with the qr code expo it stuck on an endless loading screen.一开始它运行良好,我可以使用 expo 中的二维码在我的手机上启动应用程序而没有问题。但是一段时间后它停止工作,当我现在尝试使用二维码 expo 在我的手机上加载应用程序时它卡住了在无尽的加载屏幕上。 I don't get any error messages and the app loads perfectly fine when I start it inside the browser, again without any error messages.
我没有收到任何错误消息,当我在浏览器中启动它时,应用程序加载得非常好,同样没有任何错误消息。
I tried to delete the node_modules folder and reinstall it with yarn and npm, like it was recommended, but it still doesn't work.我尝试删除 node_modules 文件夹并使用 yarn 和 npm 重新安装它,就像推荐的那样,但它仍然不起作用。
I think it started after I installed some package, but even after I removed it it still didn't work:我认为它是在我安装了一些 package 之后启动的,但即使在我删除它之后它仍然无法正常工作:
my installed packages (from package-lock.json and package.json (the packages are exactly the same) ):我安装的包(来自 package-lock.json 和 package.json(包完全相同)):
"@react-navigation/native": "^3.8.4",
"expo": "~42.0.1",
"expo-barcode-scanner": "~10.2.2",
"expo-splash-screen": "~0.11.2",
"expo-status-bar": "~1.0.4",
"expo-updates": "~0.8.1",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "~0.63.4",
"react-native-camera": "^4.0.0",
"react-native-gesture-handler": "~1.10.2",
"react-native-reanimated": "~2.2.0",
"react-native-screens": "~3.4.0",
"react-native-unimodules": "~0.14.5",
"react-native-web": "~0.13.12",
"react-navigation": "^4.4.4",
"react-navigation-stack": "^2.10.4"
I also removed the routing from App.js and replaced it with some basic code, but it still doesn't work:我还从 App.js 中删除了路由并用一些基本代码替换了它,但它仍然不起作用:
import React from 'react';
import { Text, View } from 'react-native';
const YourApp = () => {
return (
<View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<Text>
Try editing me! 🎉
</Text>
</View>
);
}
export default YourApp;
In my case it was a.network problem I had to reset the router.就我而言,这是一个网络问题,我不得不重置路由器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.