Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Android testing is broken with Bazel 4.2.1

未关闭
#417 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
android, java

调研方向

首先复现使用 Bazel 4.2.1 时的 Android 构建失败,然后检查第 29 行的 ui/espresso/IntentsAdvancedSample/BUILD.bazel 和 ImageViewHasDrawableMatcher.java。确认 BoundedDiagnosingMatcher 不可用的原因,并验证 Android 测试构建已恢复成功,以便重新启用下游覆盖率。

由索引模型根据 Issue 内容生成。

描述

https://buildkite.com/bazel/android-testing/builds/1621#cb6c258b-3b33-4421-8f99-d46a2118eece

(00:19:04) ERROR: /workdir/ui/espresso/IntentsAdvancedSample/BUILD.bazel:29:16: Building ui/espresso/IntentsAdvancedSample/libIntentsAdvancedSampleTestLib.jar (2 source files) failed: (Exit 1): java failed: error executing command
  (cd /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/execroot/__main__ && \
  exec env - \
    LC_CTYPE=en_US.UTF-8 \
    PATH=/var/lib/buildkite-agent/.cache/bazelisk/downloads/bazelbuild/bazel-4.2.1-linux-x86_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
  external/remotejdk11_linux/bin/java -XX:+UseParallelOldGC -XX:-CompactStrings '--patch-module=java.compiler=external/remote_java_tools_linux/java_tools/java_compiler.jar' '--patch-module=jdk.compiler=external/remote_java_tools_linux/java_tools/jdk_compiler.jar' '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED' '--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED' '--add-opens=java.base/java.nio=ALL-UNNAMED' '--add-opens=java.base/java.lang=ALL-UNNAMED' -jar external/remote_java_tools_linux/java_tools/JavaBuilder_deploy.jar @bazel-out/android-armeabi-v7a-fastbuild/bin/ui/espresso/IntentsAdvancedSample/libIntentsAdvancedSampleTestLib.jar-0.params @bazel-out/android-armeabi-v7a-fastbuild/bin/ui/espresso/IntentsAdvancedSample/libIntentsAdvancedSampleTestLib.jar-1.params)
Execution platform: @local_config_platform//:host
ui/espresso/IntentsAdvancedSample/app/src/androidTest/java/com/example/android/testing/espresso/intents/AdvancedSample/ImageViewHasDrawableMatcher.java:19: error: cannot find symbol
import androidx.test.espresso.matcher.BoundedDiagnosingMatcher;
                                     ^
  symbol:   class BoundedDiagnosingMatcher
  location: package androidx.test.espresso.matcher
ui/espresso/IntentsAdvancedSample/app/src/androidTest/java/com/example/android/testing/espresso/intents/AdvancedSample/ImageViewHasDrawableMatcher.java:32: error: cannot find symbol
        return new BoundedDiagnosingMatcher<View, ImageView>(ImageView.class) {
                   ^
  symbol:   class BoundedDiagnosingMatcher
  location: class ImageViewHasDrawableMatcher
ui/espresso/IntentsAdvancedSample/app/src/androidTest/java/com/example/android/testing/espresso/intents/AdvancedSample/ImageViewHasDrawableMatcher.java:33: error: method does not override or implement a method from a supertype
            @Override
            ^
ui/espresso/IntentsAdvancedSample/app/src/androidTest/java/com/example/android/testing/espresso/intents/AdvancedSample/ImageViewHasDrawableMatcher.java:38: error: method does not override or implement a method from a supertype
            @Override
            ^

Since Android Testing is broken with Bazel 4.2.1 for a long time, I'll disable it in Bazel downstream. Android testing will no longer get any test coverage with Bazel@HEAD, but we can re-enable it in downstream when this issue is fixed.

主要语言
Java
星标
9.3k
派生
3.6k
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

android/testing-samples 的其他 Issue

查看 android/testing-samples 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。