You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native Hello World应用构建失败:Invalid sdkVersion错误求助

Fixing Invalid sdkVersion & Persistent Loading Issues in Your React Native Hello World App

Hey there, let's work through this problem step by step! The core issue here is that your project's sdkVersion doesn't align with the valid versions supported by your Expo setup, which is causing the endless loading when you scan the QR code. Here's how to resolve it:

Step 1: Update the sdkVersion in your project configuration

The error message explicitly lists valid SDK versions, so we need to adjust your project's settings to use one of these:

  • Open the app.json file in your AwesomeProject folder
  • Locate the line with "sdkVersion": "<your-current-version>"
  • Replace the version number with a valid option from the error list (e.g., 17.0.0 is a stable, recent choice)
  • Save the file

Step 2: Clean up dependencies and clear caches

Since you downgraded npm, there might be cached or mismatched dependencies causing conflicts:

  • First, stop the running packager with Ctrl+C
  • Delete the node_modules folder and package-lock.json file from your project directory
  • Run npm cache clean --force to clear npm's local cache
  • Reinstall dependencies with npm install

Step 3: Restart the project and test the connection

  • Launch the packager again with npm start
  • When the prompt appears, press R (uppercase) to restart the packager and clear its cache
  • Now try scanning the QR code again with your Expo app

Quick additional checks to ensure success

  • Confirm your phone and computer are connected to the same local network (this is essential for the device to reach the packager)
  • Update your Expo app on your mobile device to the latest version—outdated apps often have compatibility issues with newer SDKs
  • If using an emulator, double-check it's running properly before pressing a (Android) or i (iOS) to launch the app

内容的提问来源于stack exchange,提问作者user3257598

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 06:28:11