Android runner can't start on a Windows host: SDK binaries are looked up without .exe or .bat
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- android, nodejs, react-native, typescript
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Bắt đầu từ packages/platform-android/src/environment.ts, nơi getAdbBinaryPath, getEmulatorBinaryPath, getSdkManagerBinaryPath và getAvdManagerBinaryPath tạo đường dẫn SDK mà không có phần mở rộng của Windows. Kiểm tra cách ensureAndroidAdbAvailable và ensureAndroidCommandLineTools sử dụng các đường dẫn này, và nơi các tệp .bat được khởi chạy, việc này cần shell: true trên win32. Hoàn thành khi việc tra cứu phân giải được adb.exe, emulator.exe, sdkmanager.bat và avdmanager.bat trên Windows, và trình chạy Android vượt qua bước kiểm tra SDK trên máy chủ Windows.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- On Windows, with
ANDROID_HOMEset to an Android SDK that has platform-tools and cmdline-tools, build the playground for Android. - Run
react-native-harness --harnessRunner androidinapps/playground. - It exits before reaching the emulator.
- Ngôn ngữ chính
- TypeScript
- Star
- 333
- Fork
- 20
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của callstackincubator/react-native-harness
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Windows Android SDK path not foundCó thể đã có người làm @V3RON đã nhận 35 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Android startup retries do not restore lost adb reverse mappingsCó thể đã có người làm @l2hyunwoo đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Ship prebuilt iOS XCTest agent artifacts and re-sign them locally instead of building per deviceĐang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của callstackincubator/react-native-harness
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Pet submission: Sleepwing / 眠翼鸟Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
OpenPetsHQ/openpets#273 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
fritzprix/libr-agent#2161 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS: clicking a menu item that has a submenu closes the menu instead of opening the submenuĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
blackboardsh/electrobun#581 ·
-
backlog-skill effort:xs frontend infra ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
LucasSantana-Dev/Lucky#2862 ·
Maintainer thường phản hồi trong vòng 1 ngày