intellij: Linting not working in Android Studio using rules_jvm_external

Android Studio plugin cannot resolve external libraries imported by bazelbuild/rules_jvm_external. I’ve tried so many setting and configurations, reinstalling android studio and plugin and clicked on the sync button (all the variants) without any success.

This is what I see when I open any source file (java) in my project: cannotresolvsymbol

BUILD file:

android_library(
    name = "remote_control_activity",
    srcs = glob([
        "*.java",
        "CustomWidgets/**/*.java",
    ]),
    assets = glob([
        "assets/**",
    ]),
    assets_dir = "assets",
    manifest = "AndroidManifest.xml",
    resource_files = glob([
        "res/**",
        "CustomWidgets/res/**",
    ]),
    deps = [
        artifact("androidx.appcompat:appcompat"),
        artifact("androidx.core:core"),
        artifact("androidx.drawerlayout:drawerlayout"),
        #artifact("androidx.fragment:fragment"),
        "@maven//:androidx_fragment_fragment",
        artifact("com.google.android.material:material"),
    ],
)

Building and installing on emulator have always worked fine in IDE but I can’t get the IDE linting to work (only those imported by rules_jvm_external) which make Android Studio pretty useless with Bazel.

Am I doing something wrong? Is it intended to not work? Missing support for rules_jvm_external? Please enlighten me!

OS: Linux (Ubuntu 18.04) Bazel version: 0.24.0 Andorid Studio: 3.3.0 and 3.4.0-RC3 Bazel plugin: Many different commits on HEAD:master during the past months. Language: Java (Android)

Best Regards

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 28 (5 by maintainers)

Most upvoted comments

Okay, I reproduce and figured out the problem. Fix should be available shortly.