Android Studio - 在 Android 上构建和安装应用程序所需

And*_*oid 6 android react-native

react-native doctor在 Visual Studio Code for React Native 应用程序的终端上运行命令后,它给出\n\xe2\x9c\x96 Android Studio - Required for building and installing your app on Android

\n

Android Studio 已安装在 Windows 10 上,并且可以在 Android 本机应用程序中正常运行。\n我可以在 React Native 设置中更改 Android Studio 的路径吗?

\n

Cap*_*ain 8

对于那些遇到以下错误的人:

\n
Android\n \xe2\x9c\x93 Adb - Required to verify if the android device is attached correctly\n \xe2\x9c\x93 JDK - Required to compile Java code\n \xe2\x9c\x93 Android Studio - Required for building and installing your app on Android\n \xe2\x9c\x96 Android SDK - Required for building and installing your app on Android\n   - Versions found: N/A\n   - Version supported: 33.0.0\n \xe2\x9c\x93 ANDROID_HOME - Environment variable that points to your Android SDK installation\n
Run Code Online (Sandbox Code Playgroud)\n

我通过安装Android SDK Command-line Tools (latest)Android Studio > 工具 > SDK Manager > SDK 工具 > Android SDK 命令行工具来解决这个问题。

\n

可能有帮助的其他资源:
\n https://remarkablemark.org/blog/2022/11/01/fix-react-native-doctor-android-errors/ \n https://developer.android.com/tools/

\n


Ana*_*een 1

我也有同样的问题。我的甚至表明:

\n
    Android\n \xe2\x9c\x93 JDK\n \xe2\x9c\x96 Android Studio - Required for building and installing your app on Android\n \xe2\x9c\x96 Android SDK - Required for building and installing your app on Android   \n   - Versions found: N/A\n   - Version supported: 29.0.3\n \xe2\x9c\x93 ANDROID_HOME\n\nErrors:   2\nWarnings: 0 \nUsage\n \xe2\x80\xba Press f to try to fix issues.\n \xe2\x80\xba Press e to try to fix errors.\n \xe2\x80\xba Press w to try to fix warnings.\n \xe2\x80\xba Press Enter to exit.\n
Run Code Online (Sandbox Code Playgroud)\n

在此输入图像描述

\n

我厌倦了所有在线的不起作用的步骤,只需单击“e”。\n它花了一些时间并安装了上述缺少的程序(请注意,我已经安装了 Android studio 和所有 SDK 说明之前有过react-native 文档,但由于某种原因没有被检测到)

\n

当我运行时npx react-native doctor,问题得到解决:

\n

在此输入图像描述

\n

请注意,这可能会消耗一定量的带宽,因为它会重新下载 Android studio 和所有其他依赖项(也许所有内容都应该约为 2GB 的数据),并且建议使用强大的互联网连接。

\n

  • 我尝试使用“npx react-native doctor”中的 e 选项。完成后显示“Android SDK已配置”。您可能需要重新启动电脑才能使所有更改生效。我立即尝试运行“npx react-native doctor”并收到“Android SDK - 在 Android 上构建和安装应用程序所需的 - 发现版本不适用”错误再次。我重新启动并重新运行“npx react-native doctor”,但它仍然找不到 Android SDK。 (2认同)