-
Notifications
You must be signed in to change notification settings - Fork 49
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
@@androidsdk//:dx_jar_import' is misplaced #298
Comments
@kiritgothi Could you please provide complete steps to reproduce this issue? Thanks |
I am building "android-testdpc" project with "bazel build testdpc" command. Unfortunately I got error in both windows and ubuntu. This error comes from cache file of bazel which build. ERROR: %user%/jjzqyj3b/external/bazel_tools/tools/android/BUILD:248:12: in runtime_deps attribute of java_binary rule @@bazel_tools//tools/android:dexer: alias '//external:android/dx_jar_import' referring to filegroup rule '@@androidsdk//:dx_jar_import' is misplaced here (expected cc_binary, cc_library, genrule, genproto, java_import, java_library, java_proto_library, java_lite_proto_library, proto_library, sh_binary or sh_library) and '@@androidsdk//:dx_jar_import' does not have mandatory providers: 'CcInfo' or 'JavaInfo'. Since this rule was created by the macro 'java_binary', the error might have been caused by the macro implementation |
Are you using the rules from github.com/bazelbuild/rules-android or the built-in ("native") android rules? Do you see the same failure if you pass |
Answering my own question, looking at https://github.com/googlesamples/android-testdpc/blob/master/BUILD, these are the native rules. |
I wasn't able to reproduce this error, here or during debugging in bazelbuild/bazel#21632 with a fork of android-testdpc (at the time it had only 1 commit difference that shouldn't be relevant here) -- are there any other details you can give to help reproduce the error? |
I did some tests as well on two different machines (Mac OS and Debian) and I cannot reproduce this with Bazel v7.1.0. |
I think this may be happening with bzlmod projects when the $ANDROID_HOME environment variable is not set |
I faced that issue but resolved with
above gottagofaster236's comment. export ANDROID_HOME={YOUR_HOME_DIR}/Android/Sdk |
I'm experiencing the same issue for the first time while building this new Bazel build for testDPC 9.0.6. I'm using Bazel v7.1.1 and Debian OS. I will get back if ever I find a fix for this. |
I tried this one again and it works. Make sure that you run |
android_sdk_repository still references dx: rules_android/rules/android_sdk_repository/helper.bzl Lines 398 to 411 in 8ab67ca
|
Description of the bug:
/bazel_tools/tools/android/BUILD:248:12: in runtime_deps attribute of java_binary rule @@bazel_tools//tools/android:dexer: alias '//external:android/dx_jar_import' referring to filegroup rule '@@androidsdk//:dx_jar_import' is misplaced here (expected cc_binary, cc_library, genrule, genproto, java_import, java_library, java_proto_library, java_lite_proto_library, proto_library, sh_binary or sh_library) and '@@androidsdk//:dx_jar_import' does not have mandatory providers: 'CcInfo' or 'JavaInfo'. Since this rule was created by the macro 'java_binary', the error might have been caused by the macro implementation
Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
No response
Which operating system are you running Bazel on?
Windows 11, And Ubuntu 22.0
What is the output of
bazel info release
?release 7.0.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: