I'm trying to update to 1.6.0-beta01 and `./gradle...
# compose
v
I'm trying to update to 1.6.0-beta01 and
./gradlew check
fails with an error message I don't really understand. 🧵
Copy code
Lint found an issue registry (androidx.compose.runtime.lint.RuntimeIssueRegistry)
which contains some references to invalid API:
org.jetbrains.kotlin.analysis.api.session.KtAnalysisSessionProvider: 
[...]
Copy code
> Task :app:lintDemoDebug FAILED
/home/runner/.gradle/caches/transforms-3/d23adda673b13392f4128346b11591b3/transformed/runtime-release/jars/lint.jar: Error: Library lint checks reference invalid APIs; these checks will be skipped!

Lint found an issue registry (androidx.compose.runtime.lint.RuntimeIssueRegistry)
which contains some references to invalid API:
org.jetbrains.kotlin.analysis.api.session.KtAnalysisSessionProvider: org.jetbrains.kotlin.analysis.api.lifetime.KtLifetimeTokenFactory getTokenFactory()
(Referenced from androidx/compose/runtime/lint/AutoboxingStateCreationDetector.class)

Therefore, this lint check library is not included
in analysis. This affects the following lint checks:
AutoboxingStateValueProperty
AutoboxingStateCreation
CoroutineCreationDuringComposition
FlowOperatorInvokedInComposition
ComposableLambdaParameterNaming
ComposableLambdaParameterPosition
ComposableNaming
StateFlowValueCalledInComposition
CompositionLocalNaming
MutableCollectionMutableState
ProduceStateDoesNotAssignValue
RememberReturnType
OpaqueUnitKey
UnrememberedMutableState

To use this lint check, upgrade to a more recent version
of the library. [ObsoleteLintCustomCheck]

   Explanation for issues of type "ObsoleteLintCustomCheck":
   Lint can be extended with "custom checks": additional checks implemented by
   developers and libraries to for example enforce specific API usages
   required by a library or a company coding style guideline.

   The Lint APIs are not yet stable, so these checks may either cause a
   performance degradation, or stop working, or provide wrong results.

   This warning flags custom lint checks that are found to be using obsolete
   APIs and will need to be updated to run in the current lint environment.

   It may also flag issues found to be using a newer version of the API,
   meaning that you need to use a newer version of lint (or Android Studio or
   Gradle plugin etc) to work with these checks.
Does this mean I would have to upgrade to • Android Gradle Plugin 8.3.0-alpha09 which requires ◦ Android Studio Iguana | 2023.2.1 Canary 9Gradle 8.4 for the check in 1.6.0-beta01 to pass or am I missing something here? blob thinking fast
Bumping this thread because running lint/check on 1.6.0-beta01 still fails. Created an issue for this: https://issuetracker.google.com/issues/311925526
j
👋 Any luck with solving this? I found a workaround: in `gradle.properties`:
Copy code
# workaround for <https://issuetracker.google.com/issues/311218673>
# see versions here: <https://maven.google.com/web/index.html?q=lint#com.android.lint:com.android.lint.gradle.plugin>
#noinspection GradleDependency
android.experimental.lint.version=8.3.0-beta02
But I was wondering if there was something else I could do instead of waiting for AGP 8.3.0 to be stable blob thinking upside down?
v
I've just been using the beta version for lint, haven't noticed any issues with it
gratitude thank you 1
👍 1
j
Haven’t you by any chance run into false positive
UnsafeOptInUsageError
reported by lint. I have couple of places where I have
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api"
added to
freeCompilerArgs
, but now it started being reported by the lint. Switching from
freeCompilerArgs
to
@OptIn
annotation doesn’t help either
v
I don't have material3 but other opt-ins seem to be working normally with no errors/warnings
gratitude thank you 1
a
I tried the workaround and now I'm getting
UnsafeOptInUsageError
for
ExperimentalMaterial3Api
despite opting in via
freeCompilerArgs
j
Yup, I have the same issue 😕
v
I'm running into a similar issue wherein I have my own opt in annotation defined in a library project. Previously in AGP 8.2, the lint took my freeCompilerArgs into account. But after 8.3, I'm getting the
UnsafeOptInUsageError
a
I updated from Android Studio Hedgehog to Iguana, and updated AGP to 8.3, then I placed
@file:OptIn(ExperimentalMaterial3Api::class)
on top of the file that had the
UnsafeOptInUsageError
issues, and it worked. Which is weird since I still have
-opt-in=androidx.compose.material3.ExperimentalMaterial3Api"
added to
freeCompilerArgs
v
This is an issue for me across multiple files because I define my own Opt In annotation I filed a bug for it, and it is a legitimate regression in AGP 8.3: https://issuetracker.google.com/issues/328105511 A googler posted the precise reproduction scenario:
the issue seems specific to data classes using types that require opt-in
gratitude thank you 1
970 Views