React native android 构建错误

React native android build error

尝试在基于 quick start guide 的模拟器上 android 编译和 运行 构建本机反应。一般来说,我是 android 开发人员的新手。 运行 当我执行 $ react-native run-android

时出现这个错误
SSYY:test $ react-native run-android
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72300Library FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:prepareComAndroidSupportAppcompatV72300Library'.
> Failed to create parent directory '/Users/SSYY/Projects/react-test/test/android/app/build' when creating directory '/Users/SSYY/Projects/react-test/test/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0'
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

有什么想法或建议吗?我确实遵循了整个 android 设置。

我有一个类似的问题,在花了很多时间和大量搜索这个问题之后,唯一的技巧是:

  1. 请如图所示安装所需的SDKConfigure Required SDKs
  2. 如果您已经安装了它,那么您必须更新以下SDK:
    • Android SDK Tool(更新到最新版本)
    • Android SDK Platform-tools(更新到最新版本)
    • Android SDK Build-tools(更新到最新版本)
    • Android Support RepositoryExtra 文件夹下(更新到最新版本)
  3. 您必须至少安装与已安装Android SDK Build-tools & Android SDK Platform-tools版本相同的Android API版本,如图Configure Required SDKs
  4. 确保 ANDROID_HOME 环境变量包含 SDK 的正确路径,例如:C:\Android\Sdk
  5. 确保 PATH 环境变量包含 SDK/platform 工具的路径 & SDK/tools 如:%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;

Note: Local Maven repository for Support Libraries which is listed as the SDK requirement in the official docs of React-native is now named as Android Support Repository in the SDK Manager .