Status Update
Comments
za...@gmail.com <za...@gmail.com> #2
Quick edit: This is with AGP 8.3.0-rc02, not rc01
za...@gmail.com <za...@gmail.com> #3
It does seem to work correctly across module, so just specific to friend compilations within the same module
ga...@google.com <ga...@google.com> #4
This is a regression from AGP 8.2.2.
ga...@google.com <ga...@google.com> #5
Using the attached project and running ./gradlew :lib2:jar :lib:lint
fails in 8.3.0-rc02. Updating gradle/libs.versions.toml
with 8.2.2 fixes the issues.
Superclass detection in detector fails (see SampleCodeDetector.kt
):
override fun createUastHandler(context: JavaContext): UElementHandler {
return object : UElementHandler() {
override fun visitClass(node: UClass) {
if (node.name == "MyClassTest") {
val supertype = node.uastSuperTypes.single().getQualifiedName()
check(supertype == "com.example.lib.SlackJvmTest")
}
}
}
}
It does look like test has no reference on main in build/intermediates/unit_test_lint_model/global/generateJvmTestLintModel/main.xml
. Scott, can you please take a look?
sp...@google.com <sp...@google.com>
an...@google.com <an...@google.com> #7
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Iguana | 2023.2.1 Patch 1
- Android Gradle Plugin 8.3.1
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
Description
DESCRIBE THE ISSUE IN DETAIL:
While testing AGP 8.3 RCs, I noticed a strange issue where lint models types from sibling source sets as
<ErrorType>
. The simplest example of this is having a type inmain
that is used intest
sources.Example:
We have a kotlin.jvm project that defines this class in its
main
source setThen we also have a test in its
test
source set that usesSlackJvmTest
like soWhere things get weird is we have a lint check that enforces use of our common base test classes like
SlackJvmTest
, and that lint check suddenly started reporting an error on this case. After investigating, we found it's because lint reports the superclass as anErrorType
, where theasSourceString()
of that class looks like thisReproduced using both the bundled lint and also
android.experimental.lint.version=8.4.0-alpha10
. This also appears to affect all references (methods, classes, etc).