Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every rule of type composer_instrumentation_test implicitly depends upon the target ... #7

Open
changusmc opened this issue Nov 1, 2019 · 2 comments

Comments

@changusmc
Copy link

I have a source Android Library (no app), in the test package, I create an Android Binary and try to use composer_instrumentation_test error is linked below

# Test app and library
android_binary(
    name = "test_app",
    manifest = "AndroidManifest.xml",
    deps = ["//android/observer"],
    # ...
)

composer_instrumentation_test(
    name = "BasicSampleComposerTest",
    test_apk = ":test_app",
    device_type = "pixel",  # pixel, pixel_c, nexus_4, generic_4_7, etc.
    api_level = 28,  # Ensure that you have the required system image downloaded into your SDK
    google_apis = True,
)

Setup

Bazel 1.0.0
MacOSX 10.15

# Kotlin Rule
rules_kotlin_version = "legacy-1.3.0-rc1"
rules_kotlin_sha = "9de078258235ea48021830b1669bbbb678d7c3bdffd3435f4c0817c921a88e42"
http_archive(
    name = "io_bazel_rules_kotlin",
    urls = ["https://github.com/bazelbuild/rules_kotlin/archive/%s.zip" % rules_kotlin_version],
    type = "zip",
    strip_prefix = "rules_kotlin-%s" % rules_kotlin_version,
    sha256 = rules_kotlin_sha,
)

KOTLIN_VERSION = "1.3.20"
KOTLINC_RELEASE_SHA = "2d505fb505c53db7fc6a2a570d97ba3b7a6d3526d4f64aee28de6fda7502f3f0"

KOTLINC_RELEASE = {
    "urls": [
        "https://github.com/JetBrains/kotlin/releases/download/v{v}/kotlin-compiler-{v}.zip".format(v = KOTLIN_VERSION),
    ],
    "sha256": KOTLINC_RELEASE_SHA,
}

RULES_EXPERIMENTAL_ANDROID_COMMIT = "c8f9faf725f13c34ddc3a50ef1dbee0e535ae297"

http_archive(
    name = "rules_experimental_android",
    url = "https://github.com/jin/rules_experimental_android/archive/%s.zip" % RULES_EXPERIMENTAL_ANDROID_COMMIT,
    strip_prefix = "rules_experimental_android-%s" % RULES_EXPERIMENTAL_ANDROID_COMMIT,
)

Error

ERROR: /Users/changd/dev/xplat/android/dbx/base/observer/src/androidTest/java/com/dropbox/base/observer/BUILD.bazel:31:1: every rule of type composer_instrumentation_test implicitly depends upon the target '@androidsdk//:tools/bin/avdmanager', but this target could not be found because of: no such target '@androidsdk//:tools/bin/avdmanager': target 'tools/bin/avdmanager' not declared in package ''; however, a source file of this name exists.  (Perhaps add 'exports_files(["tools/bin/avdmanager"])' to /BUILD?) defined by /private/var/tmp/_bazel_changd/ce997885b764ebcf5b86af5c7d6656de/external/androidsdk/BUILD.bazel
ERROR: /Users/changd/dev/xplat/android/dbx/base/observer/src/androidTest/java/com/dropbox/base/observer/BUILD.bazel:31:1: every rule of type composer_instrumentation_test implicitly depends upon the target '@androidsdk//:tools/emulator', but this target could not be found because of: no such target '@androidsdk//:tools/emulator': target 'tools/emulator' not declared in package ''; however, a source file of this name exists.  (Perhaps add 'exports_files(["tools/emulator"])' to /BUILD?) defined by /private/var/tmp/_bazel_changd/ce997885b764ebcf5b86af5c7d6656de/external/androidsdk/BUILD.bazel

@jin
Copy link
Owner

jin commented Nov 7, 2019

Oof, this is bazelbuild/bazel#7823 but it got rolled back.

@jinchizhou
Copy link

Will this be unblocked? Still getting this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants