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.jsonfile in yourAwesomeProjectfolder - Locate the line with
"sdkVersion": "<your-current-version>" - Replace the version number with a valid option from the error list (e.g.,
17.0.0is 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_modulesfolder andpackage-lock.jsonfile from your project directory - Run
npm cache clean --forceto 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) ori(iOS) to launch the app
内容的提问来源于stack exchange,提问作者user3257598
相关产品推荐
相关产品推荐

