/lint-issue-repro

Reproducer for https://issuetracker.google.com/issues/442623891

Primary LanguageKotlin

Reproducer for Google Issue 442623891

Link

Custom Lint issues are not reliably highlighted in the IDE for pure-Java/Kotlin modules. This repository contains of an Android app, a Kotlin lib and a custom Lint checks registry. This registry contains one custom Lint check that discourages developers from using Kotlin's runCatching method.

How to observe the issue

  • Open MainActivity in the app module and observe how the runCatching usage in onCreate() is properly highlighted in the IDE
  • Open MyClass in the lib module and observe how the runCatching usage in calculate() is not properly highlighted in the IDE
  • Run ./gradlew :app:lintDebug and observe how the task reports the Lint issue
  • Run ./gradlew :lib:lintJvm and observe how the task reports the Lint issue

Since Lint correctly identifies the rule violation in the pure-Kotlin library module, the expectation is that it should also highlight this to the developer proactively via the IDE.

Test environment

Android Studio Narwhal 4 Feature Drop | 2025.1.4 Canary 3 Build #AI-251.27812.49.2514.14014849, built on August 29, 2025 Runtime version: 21.0.7+-13880790-b1038.58 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.lwawt.macosx.LWCToolkit macOS 15.6 Kotlin plugin: K2 mode Kotlin analyzer version: 2.2.255-dev-255 GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 4096M Cores: 12 Metal Rendering is ON Registry: ide.instant.shutdown=false ide.experimental.ui=true gradle.phased.sync.enabled=true com.android.studio.ml.activeModel=com.android.studio.ml.AidaModel