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

ASWB can't import an project if it uses 'rules_android' rules. #7296

Closed
KirillTim opened this issue Feb 10, 2025 · 2 comments
Closed

ASWB can't import an project if it uses 'rules_android' rules. #7296

KirillTim opened this issue Feb 10, 2025 · 2 comments
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: Android Studio Android Studio plugin type: bug

Comments

@KirillTim
Copy link

Description of the bug:

The ASWB doesn't correctly handle starlarkified Android rules, defined in https://github.com/bazelbuild/rules_android.

Please take a look at the small reproducer app: https://github.com/KirillTim/rules_android_basicapp and follow the readme on how to get the root cause error.

In short, intellij_info_impl.bzl aspect refers to the android_common.AndroidIdeInfo symbol, that is not defined by the rules_android with the following stacktrace:

ERROR: /usr/local/google/home/ktimofeev/Work/rules_android_basicapp/main/BUILD:9:16: in @@intellij_aspect//:intellij_info_bundled.bzl%intellij_info_aspect aspect on android_library rule //main:basic_lib: 
Traceback (most recent call last):
        File "/usr/local/google/home/ktimofeev/.cache/bazel/_bazel_ktimofeev/d2668ece4a91d3a1e8de052a3579464e/external/intellij_aspect/intellij_info_bundled.bzl", line 67, column 37, in _aspect_impl
                return intellij_info_aspect_impl(target, ctx, semantics)
        File "/usr/local/google/home/ktimofeev/.cache/bazel/_bazel_ktimofeev/d2668ece4a91d3a1e8de052a3579464e/external/intellij_aspect/intellij_info_impl_bundled.bzl", line 1161, column 35, in intellij_info_aspect_impl
                handled = collect_android_info(target, ctx, semantics, ide_info, ide_info_file, output_groups) or handled
        File "/usr/local/google/home/ktimofeev/.cache/bazel/_bazel_ktimofeev/d2668ece4a91d3a1e8de052a3579464e/external/intellij_aspect/intellij_info_impl_bundled.bzl", line 791, column 40, in collect_android_info
                handled = _collect_android_ide_info(target, ctx, semantics, ide_info, ide_info_file, output_groups) or handled
        File "/usr/local/google/home/ktimofeev/.cache/bazel/_bazel_ktimofeev/d2668ece4a91d3a1e8de052a3579464e/external/intellij_aspect/intellij_info_impl_bundled.bzl", line 817, column 25, in _collect_android_ide_info
                android = target[android_common.AndroidIdeInfo]
Error: <target //main:basic_lib> (rule 'android_library') doesn't contain declared provider 'AndroidIdeInfo'

Which category does this issue belong to?

Android Studio

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

The simplest way to reproduce the bug is to checkout this project: https://github.com/KirillTim/rules_android_basicapp, that essentially contains of single MODULE.bazel and BUILD file and follow the steps described in repository readme.

Which Intellij IDE are you using? Please provide the specific version.

Android Studio 2024.2.2, Build #AI-242.23726.103.2422.12816248

What programming languages and tools are you using? Please provide specific versions.

Bazel version 7.5.0, rules_android version 0.6.0

What Bazel plugin version are you using?

12816248-api-version-242

Have you found anything relevant by searching the web?

The same issue reported earlier: #7123

Any other information, logs, or outputs that you want to share?

No response

@KirillTim KirillTim added awaiting-maintainer Awaiting review from Bazel team on issues type: bug labels Feb 10, 2025
@github-actions github-actions bot added the product: Android Studio Android Studio plugin label Feb 10, 2025
@mai93
Copy link
Collaborator

mai93 commented Feb 10, 2025

Thanks @KirillTim! Can you please open a bug about this under this component instead? Android Studio plugin issues are tracked there.

@KirillTim
Copy link
Author

@github-project-automation github-project-automation bot moved this from Untriaged to Done in Bazel IntelliJ Plugin Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: Android Studio Android Studio plugin type: bug
Projects
Development

No branches or pull requests

3 participants