I have a library with common code which uses android.util.Log
:
java_library(
name = "common",
srcs = glob(["*.java"]),
)
And I have an j2objc rule for iOS which works just fine:
j2objc_library(
name = "common_ios",
deps = ["//common"],
jre_deps = ["@bazel_j2objc//:android_util_lib"],
)
But when I use common
in my Android project:
android_binary(
name = "app",
srcs = glob(["*.java"]),
manifest = "//android:manifest",
resource_files = ["//android:resources"],
deps = ["//common"],
)
But when I run bazel build //android:app
, I get:
common/MyVeryOwnLogger.java:3: error: package android.util does not exist
import android.util.Log;
Which makes sense, as android.*
libs should not be available in a java_library
rule. Am I missing something? Is this not the recommended way to setup a project?
Thanks!