Status Update
Comments
co...@protonmail.com <co...@protonmail.com> #2
Android 5.0, 5.1: it shows context menu at top of screen, not as popup. See screenshots.
Android framework doesn't support floating toolbar before 23. So this is intended behavior.
The crash information suggests that this is an error from Snapshot. chuckj@ can you please take a look? I don't know what exactly caused the readError
in Snapshot, any suggestions? Thanks a lot!
ch...@google.com <ch...@google.com> #3
This looks like another instance of 193006595 which I am looking at now.
tn...@google.com <tn...@google.com> #4
Branch: androidx-main
commit beeb84e7be604088ad40e080a8d0adb1bacbf695
Author: Chuck Jazdzewski <chuckj@google.com>
Date: Thu Jul 08 10:04:28 2021
Remove updating the transparent snapshot
A transparent snapshot is create for the block exeucted by
`Snapshot.observe()` which registers read and write observers
but without creating a snapshot. The code to advance the
global snapshot, however, created a new transparent snapshot in
an attempt to update it to the new global snapshot it just
created. This is not necessary, however, as the transparent
snapshot will retrieve the current global snapshot from
`currentGlobalSnapshot` instead of `previousSnapshot` if
`previousSnapshot` is `null`. With the previous code, if the
global snapshot is advanced by applying a new snapshot the
"updated" transparent snapshot will be left referring to an
older snapshot instead of the most recent global snapshot.
Any snapshot object created in the newly applied snapshot
will throw an exception when it is accessed, as reported in
the bugs. The solution is to remove the apparent vetiagal code.
Test: ./gradlew :compose:r:r:tDUT
Fixes:
Change-Id: I2c0d0b8f57bf70e5a98ea36ed141d97142a5e53e
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/snapshots/Snapshot.kt
M compose/runtime/runtime/src/test/kotlin/androidx/compose/runtime/snapshots/SnapshotTests.kt
co...@protonmail.com <co...@protonmail.com> #5
Here is the full output
mac16:rollertoaster coltonidle$ ./gradlew app:lintFreeDebug
> Configure project :
The Dependency Analysis plugin is only known to work with versions of AGP between 3.5.4 and 7.0.0-alpha05. You are using 7.1.0-alpha01. Proceed at your own risk.
> Configure project :app
WARNING:API 'BaseVariant.getApplicationIdTextResource' is obsolete and has been replaced with 'VariantProperties.applicationId'.
It will be removed in version 7.0 of the Android Gradle plugin.
For more information, see TBD.
To determine what is calling BaseVariant.getApplicationIdTextResource, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
> Task :app:lintAnalyzeFreeDebug
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
/Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.10/3f4af7aff21c4ec46e3cdd645639d0a63a68d3d0/kotlin-stdlib-jdk8-1.5.10.jar (version 1.5)
/Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.10/c49d0703d16c6cb1526cc07b9b46486da1dd8a60/kotlin-stdlib-jdk7-1.5.10.jar (version 1.5)
/Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.4.31/63db9d66c3d20f7b8f66196e7ba86969daae8b8a/kotlin-reflect-1.4.31.jar (version 1.4)
/Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.5.10/da6a904b132f0402fa4d79169a3c1770598d4702/kotlin-stdlib-1.5.10.jar (version 1.5)
/Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.10/6b84d926e28493be69daf673e40076f89492ef7/kotlin-stdlib-common-1.5.10.jar (version 1.5)
w: Consider providing an explicit dependency on kotlin-reflect 1.5 to prevent strange errors
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.10/c49d0703d16c6cb1526cc07b9b46486da1dd8a60/kotlin-stdlib-jdk7-1.5.10.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.5.10/da6a904b132f0402fa4d79169a3c1770598d4702/kotlin-stdlib-1.5.10.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.10/3f4af7aff21c4ec46e3cdd645639d0a63a68d3d0/kotlin-stdlib-jdk8-1.5.10.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.intellij.deps/trove4j/1.0.20181211/216c2e14b070f334479d800987affe4054cd563f/trove4j-1.0.20181211.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.10/6b84d926e28493be69daf673e40076f89492ef7/kotlin-stdlib-common-1.5.10.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/com.android.tools.external.com-intellij/intellij-core/30.1.0-alpha01/29f6bd46f757e6915c7eb6cc7d760f3d2a4bd089/intellij-core-30.1.0-alpha01.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/com.android.tools.external.org-jetbrains/uast/30.1.0-alpha01/deb7df8d140b1dea70341eba7fad43e763fb70d5/uast-30.1.0-alpha01.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Scanning app: .............................
Scanning app (Phase 2): .....................
> Task :app:lintFreeDebug FAILED
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
/Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.10/3f4af7aff21c4ec46e3cdd645639d0a63a68d3d0/kotlin-stdlib-jdk8-1.5.10.jar (version 1.5)
/Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.10/c49d0703d16c6cb1526cc07b9b46486da1dd8a60/kotlin-stdlib-jdk7-1.5.10.jar (version 1.5)
/Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.4.31/63db9d66c3d20f7b8f66196e7ba86969daae8b8a/kotlin-reflect-1.4.31.jar (version 1.4)
/Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.5.10/da6a904b132f0402fa4d79169a3c1770598d4702/kotlin-stdlib-1.5.10.jar (version 1.5)
/Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.10/6b84d926e28493be69daf673e40076f89492ef7/kotlin-stdlib-common-1.5.10.jar (version 1.5)
w: Consider providing an explicit dependency on kotlin-reflect 1.5 to prevent strange errors
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.10/c49d0703d16c6cb1526cc07b9b46486da1dd8a60/kotlin-stdlib-jdk7-1.5.10.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.5.10/da6a904b132f0402fa4d79169a3c1770598d4702/kotlin-stdlib-1.5.10.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.10/3f4af7aff21c4ec46e3cdd645639d0a63a68d3d0/kotlin-stdlib-jdk8-1.5.10.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.intellij.deps/trove4j/1.0.20181211/216c2e14b070f334479d800987affe4054cd563f/trove4j-1.0.20181211.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.10/6b84d926e28493be69daf673e40076f89492ef7/kotlin-stdlib-common-1.5.10.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/com.android.tools.external.com-intellij/intellij-core/30.1.0-alpha01/29f6bd46f757e6915c7eb6cc7d760f3d2a4bd089/intellij-core-30.1.0-alpha01.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Custom lint rule jar /Users/coltonidle/.gradle/caches/modules-2/files-2.1/com.android.tools.external.org-jetbrains/uast/30.1.0-alpha01/deb7df8d140b1dea70341eba7fad43e763fb70d5/uast-30.1.0-alpha01.jar does not contain a valid registry manifest key (Lint-Registry-v2).
Either the custom jar is invalid, or it uses an outdated API not supported this lint client
Wrote HTML report to file:///Users/coltonidle/Dev/Projects/rollertoaster/app/build/reports/lint-results-freeDebug.html
Lint found 8 errors. First failure:
/Users/coltonidle/Dev/Projects/rollertoaster/app/src/free/java/com/rollertoaster/app/MockNetwork.kt: Error: Unexpected failure during lint analysis of MockNetwork.kt (this is a bug in lint or one of the libraries it depends on)
The crash seems to involve the detector androidx.fragment.lint.OnCreateDialogIncorrectCallbackDetector.
You can try disabling it with something like this:
android {
lintOptions {
disable "DialogFragmentCallbacksDetector"
}
}
Stack: NullPointerException:OnCreateDialogIncorrectCallbackDetector$UastHandler.visitClass(OnCreateDialogIncorrectCallbackDetector.kt:78)←UElementVisitor$DispatchPsiVisitor.visitClass(UElementVisitor.kt:597)←UElementVisitor$DelegatingPsiVisitor.visitClass(UElementVisitor.kt:1156)←AbstractKotlinUClass.accept(KotlinUClass.kt:63)←ImplementationUtilsKt.acceptList(implementationUtils.kt:23)←UFile$DefaultImpls.accept(UFile.kt:83)←KotlinUFile.accept(KotlinUFile.kt:31)←UElementVisitor$visitFile$3.run(UElementVisitor.kt:281)
You can run with --stacktrace or set environment variable LINT_PRINT_STACKTRACE=true to dump a full stacktrace to stdout. [LintError]
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintFreeDebug'.
> A failure occurred while executing com.android.build.gradle.internal.lint.AndroidLintTask$AndroidLintLauncherWorkAction
> There was a failure while executing work items
> A failure occurred while executing com.android.build.gradle.internal.lint.AndroidLintWorkAction
> Lint found errors in the project; aborting build.
Fix the issues identified by lint, or add the following to your build script to proceed with errors:
...
android {
lintOptions {
abortOnError false
}
}
...
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s
58 actionable tasks: 3 executed, 9 from cache, 46 up-to-date
co...@protonmail.com <co...@protonmail.com> #6
If I run the same command above but with --stacktrace I get this
The crash seems to involve the detector androidx.fragment.lint.OnCreateDialogIncorrectCallbackDetector.
You can try disabling it with something like this:
android {
lintOptions {
disable "DialogFragmentCallbacksDetector"
}
}
Stack: NullPointerException:OnCreateDialogIncorrectCallbackDetector$UastHandler.visitClass(OnCreateDialogIncorrectCallbackDetector.kt:78)←UElementVisitor$DispatchPsiVisitor.visitClass(UElementVisitor.kt:597)←UElementVisitor$DelegatingPsiVisitor.visitClass(UElementVisitor.kt:1156)←AbstractKotlinUClass.accept(KotlinUClass.kt:63)←ImplementationUtilsKt.acceptList(implementationUtils.kt:23)←UFile$DefaultImpls.accept(UFile.kt:83)←KotlinUFile.accept(KotlinUFile.kt:31)←UElementVisitor$visitFile$3.run(UElementVisitor.kt:281) [LintError]
tn...@google.com <tn...@google.com> #7
Thanks! This looks like it's a bug in one of the AndroidX-bundled lint checks; it looks like the problem is with the unsafe null call:
Reassigning to AndroidX for triage.
il...@google.com <il...@google.com> #8
Can you attach a sample project or enough code to reproduce this issue?
co...@protonmail.com <co...@protonmail.com> #9
I don't have a sample project, but the error points to this file seemingly?
package com.rollertoaster.app
import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
val MY_DISPATCHER: Dispatcher =
object : Dispatcher() {
override fun dispatch(request: RecordedRequest): MockResponse {
return MockResponse().setResponseCode(404)
}
}
Some more info here:
But besides that I don't have a repo that shows this publicly available.
co...@protonmail.com <co...@protonmail.com> #10
This is an unrelated issue, but Tor says "Methods aren't guaranteed to have a surrounding class so probably safest to use the ?. operator..." and so maybe that's what has to be done in this lint check as well?
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #11
Branch: androidx-main
commit 0a9efa914d322810f8dc8d9ba06e79d164c8892d
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Jun 09 13:01:36 2021
Fix lint crashes on kotlin top level properties
We need to handle cases where kotlin functions don't have a surrounding
class.
This change allows the surrounding class to be null and in that case we
just skip the check.
RelNote: "The `OnCreateDialogIncorrectCallback` lint check will no
longer crash when declaring a top level variable."
Test: kotlin anonymous object test
Bug: 189967522
Change-Id: I62de88c344cee0cb9deda26c9e5fc27247cf2d95
M fragment/fragment-lint/src/main/java/androidx/fragment/lint/OnCreateDialogIncorrectCallbackDetector.kt
M fragment/fragment-lint/src/test/java/androidx/fragment/lint/OnCreateDialogIncorrectCallbackDetectorTest.kt
il...@google.com <il...@google.com> #12
We've improved this lint check and the updated check will be available in Fragment 1.4.0-alpha03.
co...@protonmail.com <co...@protonmail.com> #13
Looking forward to it. Thanks!
de...@gmail.com <de...@gmail.com> #14
```
../../src/main/java/com/sample/app/App.kt: Unexpected failure during lint analysis of App.kt (this is a bug in lint or one of the libraries it depends on)
Message: class androidx.fragment.lint.OnCreateDialogIncorrectCallbackDetector$UastHandler tried to access protected method 'org.jetbrains.kotlin.psi.KtClassOrObject org.jetbrains.uast.kotlin.KotlinUClass.getKtClass()' (androidx.fragment.lint.OnCreateDialogIncorrectCallbackDetector$UastHandler is in unnamed module of loader com.intellij.util.lang.UrlClassLoader @10f53730; org.jetbrains.uast.kotlin.KotlinUClass is in unnamed module of loader java.net.URLClassLoader @4489af75)
The crash seems to involve the detector androidx.fragment.lint.OnCreateDialogIncorrectCallbackDetector.
You can try disabling it with something like this:
android {
lint {
disable "DialogFragmentCallbacksDetector"
}
}
Stack: IllegalAccessError:OnCreateDialogIncorrectCallbackDetector$UastHandler.visitClass(OnCreateDialogIncorrectCallbackDetector.kt:78)
←UElementVisitor$DispatchPsiVisitor.visitClass(UElementVisitor.kt:553)
←UElementVisitor$DelegatingPsiVisitor.visitClass(UElementVisitor.kt:1162)
←AbstractKotlinUClass.accept(AbstractKotlinUClass.kt:43)
←ImplementationUtilsKt.acceptList(implementationUtils.kt:29)
```
AGP 7.4.0-alpha03
Kotlin 1.6.20-M1
de...@gmail.com <de...@gmail.com> #15
de...@gmail.com <de...@gmail.com> #16
de...@gmail.com <de...@gmail.com> #17
co...@protonmail.com <co...@protonmail.com> #18
Are all of your deps up to date? This problem was fixed for me.
Description
Updated to compose beta08 and kotlin 1.5.10. Running lint gives me a few errors like this now:
Error: Unexpected failure during lint analysis of MyCustomClass.kt (this is a bug in lint or one of the libraries it depends on)