【发布时间】:2021-02-14 18:24:57
【问题描述】:
我是 react-native 的新手,我想构建和运行一个简单的应用程序。它工作正常,但是当我关闭模拟器并尝试再次运行它时,android 模拟器卡在加载屏幕上。
构建成功。我在一个终端上运行react-native start,然后在另一个终端上运行react-native run-android。这是我运行-android时终端的输出。
BUILD SUCCESSFUL in 2s
26 actionable tasks: 1 executed, 25 up-to-date
info Running adb -s emulator-5554 reverse tcp:8081 tcp:8081
info Starting the app on emulator-5554 (adb -s emulator-5554 shell am start -n com.myapp/com.myapp.MainActivity)...
Starting: Intent { cmp=com.myapp/.MainActivity }
My emulator is Nexus 5X, API version 28, memory 1536 MB.
react-native-cli version: 2.0.1
react-native version: 0.59.3
我使用的是 ubuntu 18.04,内存容量为 8gb。
我确信代码中没有错误,因为它之前运行良好。
我尝试删除节点模块并清理缓存,然后 npm install。但还是无法运行
【问题讨论】:
-
android emulator is stuck on the loading screen这不是模拟器的问题,而不是 react-native 的问题吗? -
我不知道到底是什么问题。您是否建议将模拟器添加为标签?
-
尝试关闭一切,只有在模拟器准备好后才启动模拟器运行 react-native
-
你试过检查实时日志吗?喜欢 adb logcat 吗?
标签: android react-native