Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Android runner can't start on a Windows host: SDK binaries are looked up without .exe or .bat

オープン 初心者向け
#201 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
android, nodejs, react-native, typescript
領域
mobile-dev

調査の方向性

packages/platform-android/src/environment.ts から始めてください。ここでは getAdbBinaryPath、getEmulatorBinaryPath、getSdkManagerBinaryPath、getAvdManagerBinaryPath が Windows 用の拡張子を付けずに SDK のパスを組み立てています。これらのパスが ensureAndroidAdbAvailable と ensureAndroidCommandLineTools でどのように使われているかを確認し、.bat ファイルを起動している箇所も調べてください。win32 では shell: true が必要です。完了の条件は、Windows で検索が adb.exe、emulator.exe、sdkmanager.bat、avdmanager.bat を解決し、Windows ホスト上で Android ランナーが SDK の確認を通過することです。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug

On Windows, every Android runner — emulator or physical device — fails before it reaches a device, with:

Error: Android command-line tools are missing. Set ANDROID_HOME or ANDROID_SDK_ROOT to an initialized SDK.
    at ensureAndroidCommandLineTools (packages/platform-android/dist/environment.js:114:15)
    at async ensureAndroidSdkPackages (packages/platform-android/dist/environment.js:252:5)
    at async Module.getAndroidRunner (packages/platform-android/dist/runner.js:7:5)
    at async Object.work (packages/jest/dist/harness-session.js:411:32)
    at async withPlatformReadyTimeout (packages/jest/dist/harness-session.js:99:16)
    at async Promise.all (index 1)

although ANDROID_HOME points at an SDK with platform-tools and cmdline-tools installed. (What a user actually sees is an AbortError crash; the message above shows once that is fixed: #200.)

packages/platform-android/src/environment.ts builds the SDK paths without Windows extensions: getAdbBinaryPath gives platform-tools/adb, getEmulatorBinaryPath emulator/emulator, and getSdkManagerBinaryPath / getAvdManagerBinaryPath cmdline-tools/latest/bin/sdkmanager / avdmanager, where Windows has adb.exe, emulator.exe, sdkmanager.bat and avdmanager.bat. So ensureAndroidAdbAvailable decides platform-tools is missing, the bootstrap then finds no sdkmanager, and throws. With adb.exe alone, a runner on an already running emulator works — I ran #197's reproduction that way. Appending the extension on win32 fixes the lookups; spawning a .bat also needs shell: true there, since Node's fix for CVE-2024-27980.

System Info
System:
  OS: Windows 11 10.0.26200
Binaries:
  Node: 26.5.0
SDKs:
  Android SDK:
    API Levels: 35, 36, 37
    Build Tools: 35.0.0, 36.0.0, 36.1.0, 37.0.0
react-native: 0.82.1 (apps/playground)
React Native Harness Version

1.5.0 (main at 58850ce)

Reproduction

https://github.com/callstackincubator/react-native-harness/tree/main/apps/playground

Steps to reproduce
  1. On Windows, with ANDROID_HOME set to an Android SDK that has platform-tools and cmdline-tools, build the playground for Android.
  2. Run react-native-harness --harnessRunner android in apps/playground.
  3. It exits before reaching the emulator.
主要言語
TypeScript
スター
333
フォーク
20
平均マージ
1日 15時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstackincubator/react-native-harness のほかの issue

callstackincubator/react-native-harness の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。