我在本机反应中遇到这个问题。一切都工作正常,直到我决定重新运行该项目yarn install
这是完整的错误
TypeError:未定义不是一个对象(评估“_expoModulesCore.NativeModulesProxy.ExpoSplashScreen”)在node_modules\react-native\Libraries\LogBox\LogBox.js:148:8在node_modules\react-native\Libraries\LogBox\LogBox的registerError中。 js:59:8 in errorImpl at node_modules\react-native\Libraries\LogBox\LogBox.js:33:4 in console.error at node_modules\expo\build\environment\react-native-logs.fx.js:27: 4 在node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6中出现错误,在node_modules\react-native\Libraries\Core\ExceptionsManager.js:171:19中,在node_modules\react-native\的handleException中Libraries\Core\setUpErrorHandling.js:24:6 在 node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:12:21 在 Node_modules\regenerator-runtime\runtime.js 的 ErrorUtils.setGlobalHandler$argument_0 中: 63:36 在 node_modules\regenerator-runtime\runtime.js 的 tryCatch 中:294:29 在 node_modules\regenerator-runtime\runtime.js 的调用中:63:36 在 node_modules\regenerator-runtime\runtime.js:155 的 tryCatch 中: 27 在 Node_modules\regenerator-runtime\runtime.js:165:18 在 PromiseImpl.resolve.then$argument_0 在 node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 在 tryCallOne 在 node_modules\反应本机\node_modules\promise\setimmediate\core.js:123:24在setImmediate$argument_0在node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14在_callTimer在node_modules\react-native\ Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPass at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates at node_modules\react-native\Libraries\BatchedBridge\MessageQueue。 js:387:6 在 __callImmediates 在 node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 在 __guard$argument_0 在 node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 在 __guard FlushedQueue 中的 node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4
我尝试过更新 expo-cli、expo-splash-screen 和缓存清除命令 expo r -c
如果有人可以提供帮助,请告诉我。
我正在使用 Expo 开发我的第一个 React Native 应用程序,但在启动画面方面遇到了一些问题。
\n在我的app.json博览会下我设置了以下内容:
{\n "expo": {\n "name": "my-iOS-Android-app",\n "slug": "my-iOS-Android-app",\n "version": "1.0.0",\n "orientation": "portrait",\n "icon": "./assets/icon.png",\n "splash": {\n "backgroundColor": "#C808F9"\n },\n "owner": "linus",\n "updates": {\n "fallbackToCacheTimeout": 0\n },\n "assetBundlePatterns": [\n "**/*"\n ],\n "ios": {\n "supportsTablet": true,\n "bundleIdentifier": "my.test.app"\n },\n "android": {\n "adaptiveIcon": {\n "foregroundImage": "./assets/adaptive-icon.png",\n "backgroundColor": "#FFFFFF"\n }\n },\n "web": {\n "favicon": "./assets/favicon.png"\n }\n }\n} \nRun Code Online (Sandbox Code Playgroud)\n我已按照 Expo\xc2\xb4s 网站上的指南进行操作,这是我的代码:
\nuseEffect(() => {\n async function prepare() {\n try {\n await …Run Code Online (Sandbox Code Playgroud) 初始屏幕使用异步操作等待,而字体包使用“自定义挂钩” useFonts(我猜)。如何让启动屏幕等待谷歌字体加载?