Missing `android_device`
Maintainers usually reply within 6 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 32/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- android
- Domain
- mobile-dev, testing
Research direction
Start with the linked Android instrumentation test documentation and reproduce the shown bazel query against rules_android 0.6.6 on Bazel 8.4.2. Compare the missing android_device failure with the local emulator flags cited in the issue; done would be clear documentation of the supported Bazel 8 emulator workflow or its replacement.
Written by the indexing model from the issue text.
Description
Bazel 8 removed all native Android rules, including android_device, and I can't find any information about it.
How can I use emulators with bazel 8?
I wanted to set up an instrumentation test:
Stacktrace
bazel query --output=build @android_test_support//tools/android/emulated_devices/generic_phone:android_23_x86
ERROR: Traceback (most recent call last):
File "/home/simeonwarren/.cache/bazel/_bazel_simeonwarren/8d894fd52f9ebddc50ede8e0430ca405/external/+_repo_rules+android_test_support/tools/android/emulated_devices/generic_phone/BUILD.bazel", line 13, column 12, in <toplevel>
make_device(
File "/home/simeonwarren/.cache/bazel/_bazel_simeonwarren/8d894fd52f9ebddc50ede8e0430ca405/external/+_repo_rules+android_test_support/tools/android/emulated_devices/macro/make_device.bzl", line 120, column 16, in make_device
new_devices(
File "/home/simeonwarren/.cache/bazel/_bazel_simeonwarren/8d894fd52f9ebddc50ede8e0430ca405/external/+_repo_rules+android_test_support/tools/android/emulated_devices/macro/make_device.bzl", line 258, column 48, in new_devices
_new_devices_for_image_and_emulator(
File "/home/simeonwarren/.cache/bazel/_bazel_simeonwarren/8d894fd52f9ebddc50ede8e0430ca405/external/+_repo_rules+android_test_support/tools/android/emulated_devices/macro/make_device.bzl", line 327, column 24, in _new_devices_for_image_and_emulator
make_android_device(
File "/home/simeonwarren/.cache/bazel/_bazel_simeonwarren/8d894fd52f9ebddc50ede8e0430ca405/external/+_repo_rules+android_test_support/tools/android/emulated_devices/macro/make_device.bzl", line 350, column 11, in make_android_device
native.android_device(
Error: no native function or rule 'android_device'
Environment:
- Rules:
bazel_dep(name = "rules_android", version = "0.6.6") - OS:
Fedora Linux 41 (Server Edition) - Bazel:
8.4.2
It seems like I can use a local emulator, so it's not as big of a problem as I thought:
Bazel also supports testing directly on a locally launched emulator or connected device. Pass the flags --test_strategy=exclusive and --test_arg=--device_broker_type=LOCAL_ADB_SERVER to enable local testing mode. If there is more than one connected device, pass the flag --test_arg=--device_serial_number=$device_id where $device_id is the id of the device/emulator listed in adb devices.
- Dominant language
- Java
- Stars
- 205
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bazelbuild/rules_android
-
build_java8_legacy_dex.sh does not set JAVA_RUNFILES for the d8/r8 launchersPossibly taken @TrapsterDK claimed this 17 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bazelbuild/rules_android#599 ·
Maintainers usually reply within 6 days
-
`Desugar` actions don't run on multiplex workersPossibly taken @lukaciko claimed this 46 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bazelbuild/rules_android#539 · 2 comments ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bazelbuild/rules_android#535 · 2 reactions ·
Maintainers usually reply within 6 days
-
desugar_globals output is not reproducible (zip entry order varies)Possibly taken @TrapsterDK claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
bazelbuild/rules_android#610 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
bazelbuild/rules_android#602 ·
Maintainers usually reply within 6 days
All issues in bazelbuild/rules_android
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Lincoln-cn/JAiRouter#1473 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
exercism/java-analyzer#379 ·
-
area: ui bug priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
tetsuji16/microProject#1893 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
liberation-data/fornax4j#325 ·
Maintainers usually reply within 1 day
-
[Bug]: FE and Kinesis extraction pipes render flow starting at the centre and scroll the source arm backwardsPossibly taken @chonkzillaofficial claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
BCCE-team/BuildCraft#85 ·