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

React Native Doctor检测Android SDK版本异常的原因与解决咨询

Fixing React Native Doctor's Android SDK Build Tools Version Mismatch

Hey there, let's break down why this is happening and how to fix it quickly:

Why the Mismatch?

First, let's clarify: react-native doctor checks the Android SDK Build Tools versions you have installed locally on your machine, not just the values set in your project's build.gradle. Even though your project config specifies 28.0.3, it looks like the only Build Tools version actually installed on your system is 23.0.1, which doesn't meet the >=26.x requirement.

Step-by-Step Fix

  • Install the required Build Tools version via Android Studio

    1. Open Android Studio, go to Tools > SDK Manager.
    2. Switch to the SDK Tools tab.
    3. Check the box that says "Show Package Details" at the bottom right.
    4. Scroll down to Android SDK Build Tools, expand the list, and check the box for 28.0.3 (or any version >=26.x that matches your project config). You can also uncheck 23.0.1 if you don't need it anymore to avoid confusion.
    5. Click Apply to start the installation.
  • Verify your ANDROID_HOME environment variable
    Sometimes react-native doctor might be looking at the wrong SDK directory. Open your terminal and run:

    • On macOS/Linux: echo $ANDROID_HOME
    • On Windows: echo %ANDROID_HOME%
      Make sure the path matches the SDK location you're using in Android Studio (you can find this in SDK Manager under Android SDK Location at the top).
  • Re-run react-native doctor
    Once the installation is done, run npx react-native doctor again. It should now detect the correct Build Tools version and pass the check.

If you still run into issues, double-check that the Build Tools folder exists in your SDK directory (look for sdk/build-tools/28.0.3). Sometimes installations can fail silently, so retrying the install in Android Studio might help.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.14 08:46:21