question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linting not working in Android Studio using rules_jvm_external

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
chaorencommented, Apr 23, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve your code with lint checks - Android Developers
Android Studio provides a code scanning tool called lint that can help you to identify and correct problems with the structural quality of...
Read more >
Lint checking doesn't work for Java but works for Kotlin in ...
... on a GitHub issue discussion mentioned having a similar problem and the root cause was some incompatible plugins with Android Studio, ...
Read more >
Android Studio 3.6 is not performing lint checks from modules
1. Open the Timber project. 2. Open `LintActivity` in the timber-sample module. 3. Uncheck all the suppressions. 4. From the command line, run...
Read more >
Letting Android Lint fix your code | by Niklas Baudy - Medium
Android Lint is deeply integrated into Android Studio. Issues that are reported will be highlighted either as warnings or errors. Since Android Studio...
Read more >
Lint and its Usage in Android Studio - GeeksforGeeks
We've all been using Lint since we first started using Android Studio because it comes standard with support for Lint in every project....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found