Status Update
Comments
mg...@google.com <mg...@google.com> #2
It seems the print is benign so I'll remove it; Could be worth it to find out how the message carrying information about "cb 0" (0 is not a valid color buffer handle) ever arrives to that line though
22...@gmail.com <22...@gmail.com> #3
mg...@google.com <mg...@google.com>
mg...@google.com <mg...@google.com> #4
I agree with Sergey -- while I think it's fine to remove some logging messages that aren't necessary, the root problem here is that Studio shows everything emitted as if they are errors, with one notification bubble per message. We don't do that for other tools that Studio launches, and in particular, this isn't specific to the "cb 0" message I showed here; there were earlier (different) error messages during the boot as well.
22...@gmail.com <22...@gmail.com> #5
This behavior was requested specifically by the emulator team (vharron@ iirc, so at least 3-4 years ago). Let me see if I have any more details on why this was requested.
22...@gmail.com <22...@gmail.com> #6
I couldn't find any relevant threads. IIRC, the main concern at that time was that warnings at startup (e.g. missing acceleration) really needed to be bubbled up to the users. If that is not an issue anymore, and the emulator team only wants errors to be visible, then the proposed change SGTM.
22...@gmail.com <22...@gmail.com> #7 Restricted
mg...@google.com <mg...@google.com> #8
(2) More discipline in the emulator's messages would definitely help. Right now they don't seem to follow any simple set of rules (the "Emulator: " prefix is added by Studio):
2020-05-06 11:07:04,587 [ 38858] INFO - manager.EmulatorProcessHandler - Emulator: /usr/local/google/home/sprigogin/Android/Sdk/emulator/emulator -netdelay none -netspeed full -avd Nexus_10_API_29 -no-window -gpu auto-no-window -grpc-use-token
2020-05-06 11:07:04,976 [ 39247] INFO - manager.EmulatorProcessHandler - Emulator: pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver
2020-05-06 11:07:04,985 [ 39256] INFO - manager.EmulatorProcessHandler - Emulator: E0506 11:07:04.983601525 31440 socket_utils_common_posix.cc:201] check for SO_REUSEPORT: {"created":"@1588788424.983585430","description":"SO_REUSEPORT unavailable on compiling system","file":"/mnt/tmpfs/src/android/emu-master-dev/external/grpc/src/core/lib/iomgr/socket_utils_common_posix.cc","file_line":169}
2020-05-06 11:07:05,321 [ 39592] INFO - manager.EmulatorProcessHandler - Emulator: Your emulator is out of date, please update by launching Android Studio:
2020-05-06 11:07:05,321 [ 39592] INFO - manager.EmulatorProcessHandler - Emulator: - Start Android Studio
2020-05-06 11:07:05,321 [ 39592] INFO - manager.EmulatorProcessHandler - Emulator: - Select menu "Tools > Android > SDK Manager"
2020-05-06 11:07:05,321 [ 39592] INFO - manager.EmulatorProcessHandler - Emulator: - Click "SDK Tools" tab
2020-05-06 11:07:05,321 [ 39592] INFO - manager.EmulatorProcessHandler - Emulator: - Check "Android Emulator" checkbox
2020-05-06 11:07:05,321 [ 39592] INFO - manager.EmulatorProcessHandler - Emulator: - Click "OK"
2020-05-06 11:07:05,321 [ 39592] INFO - manager.EmulatorProcessHandler - Emulator:
2020-05-06 11:07:06,475 [ 40746] INFO - manager.EmulatorProcessHandler - Emulator: emulator: INFO: LoggingInterceptor.cpp:70: 1588788426470945, rcvTime: 84, sndTime: 995, UNARY, rcv: 24, snd: 12156, /android.emulation.control.EmulatorController/getStatus() -> [...], OK
2020-05-06 11:07:07,355 [ 41626] INFO - manager.EmulatorProcessHandler - Emulator: emulator: INFO: LoggingInterceptor.cpp:70: 1588788426597819, rcvTime: 34, sndTime: 12945, SERVER_STREAMING, rcv: 48, snd: 1104071, /android.emulation.control.EmulatorController/streamScreenshot(format: RGBA8888 width: 665 height: 1064) -> [...], OK
mg...@google.com <mg...@google.com> #9
To assist us in investigate this issue, could you please provide the following details:
- Did the issue begin immediately after updating your AGP version, while keeping all other dependencies and configurations unchanged?
- What was the previous AGP version you were using, and to which version did you update?
- Did you update any other libraries or dependencies in your project besides the AGP?
- If you haven't updated to the latest AGP version yet, have you tried doing so to see if the issue persists?
22...@gmail.com <22...@gmail.com> #10
mg...@google.com <mg...@google.com>
jb...@google.com <jb...@google.com> #11
Hey Jinseong, do you know anything about this recent lent change?
js...@google.com <js...@google.com> #12
A couple clarifications:
- It looks like it's not about release apk v.s. debug. Even
./gradlew :app:lintDebug
failed locally, with the same error. - Indeed, this is introduced between AGP 8.6.0-alpha01 and 8.6.0-alpha02, and present until 8.6.0-alpha05
- Since AGP 8.6.0-alpha06, I got the following instead:
Stack: NullPointerException:OpaqueUnitKeyDetector.isNullableAny(OpaqueUnitKeyDetector.kt:205)
←OpaqueUnitKeyDetector.visitMethodCall(OpaqueUnitKeyDetector.kt:76)
←UElementVisitor$DelegatingPsiVisitor.visitMethodCallExpression(UElementVisitor.kt:778)
←UElementVisitor$DelegatingPsiVisitor.visitCallExpression(UElementVisitor.kt:758)
←KotlinUFunctionCallExpression.accept(KotlinUFunctionCallExpression.kt:271)
←ImplementationUtilsKt.acceptList(implementationUtils.kt:15)
←UBlockExpression.accept(UBlockExpression.kt:21)
←ULambdaExpression.accept(ULambdaExpression.kt:40)
←ImplementationUtilsKt.acceptList(implementationUtils.kt:15)
←KotlinUFunctionCallExpression.accept(KotlinUFunctionCallExpression.kt:275)
←ImplementationUtilsKt.acceptList(implementationUtils.kt:15)
←UBlockExpression.accept(UBlockExpression.kt:21)←ULambdaExpression.accept(ULambdaExpression.kt:40)
←ImplementationUtilsKt.acceptList(implementationUtils.kt:15)
←KotlinUFunctionCallExpression.accept(KotlinUFunctionCallExpression.kt:275)
←UQualifiedReferenceExpression.accept(UQualifiedReferenceExpression.kt:34)
←ImplementationUtilsKt.acceptList(implementationUtils.kt:15)
←UBlockExpression.accept(UBlockExpression.kt:21)
←UMethod.accept(UMethod.kt:45)
←ImplementationUtilsKt.acceptList(implementationUtils.kt:15)
←AbstractKotlinUClass.accept(AbstractKotlinUClass.kt:213)
←ImplementationUtilsKt.acceptList(implementationUtils.kt:15)
←UFile.accept(UFile.kt:89)
←UastLintUtilsKt.acceptSourceFile(UastLintUtils.kt:936)
←UElementVisitor$visitFile$3.run(UElementVisitor.kt:212)
←LintClient.runReadAction(LintClient.kt:1781)
←LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2745)
←UElementVisitor.visitFile(UElementVisitor.kt:209)
←LintDriver$visitUastDetectors$1.run(LintDriver.kt:2046)
...
which is fixed at androidx.compose.runtime
will include that fix.
In
##### 'kotlin.experimental.tryK2' results #####
:app:compileReleaseKotlin: 2.0 language version
##### 100% (1/1) tasks have been compiled with Kotlin 2.0 #####
and I also saw locally:
w: The `kotlin.experimental.tryK2` deprecated property is used in your build.
Please, stop using it as it is unsupported and may apply no effect to your build.
Note that that flag is gone after LV 2.0, and renamed to tryNext
:
But, this means you're using Kotlin LV 2.0, and we intentionally align Lint w/ K2 UAST when LV is 2.0. Thank you for early adapting new toolings!
Unfortunately(?), this means a bug in K2 UAST, and adding the following to gradle.properties
will unblock you:
#kotlin.experimental.tryK2=true
...
android.lint.useK2Uast=false
js...@google.com <js...@google.com> #13
For internal records,
Since AGP 8.6.0-alpha06, I got the following instead:
What's changed between 8.6.0-alpha05 and alpha06 is described at
22...@gmail.com <22...@gmail.com> #15
js...@google.com <js...@google.com> #16
But... perhaps this is working as intended. When I use Studio w/ K2 mode, MediatorLiveData#addSource
's lambda parameter, data
, is marked as List<OrderListEntity>?
, whereas in K1 mode, it is List<OrderListEntity>!
, indicating platform type. And, even before NullSafeMutableLiveData
check in androidx.lifecycle
reports an error, K2 IDE shows an error too (screenshot attached).
Another workaround is to specify the type, e.g.,
init {
_orders.addSource(getAllOrders()) { data: List<OrderListEntity> ->
_orders.value = data
}
}
22...@gmail.com <22...@gmail.com> #17
js...@google.com <js...@google.com> #18
js...@google.com <js...@google.com> #19
Re:
do you know anything about this recent lint change?
Indeed, this is introduced between AGP 8.6.0-alpha01 and 8.6.0-alpha02
Around May 15 cut, one major(?) change is to bump up Lint's kotlinc artifacts from 2.0.0-RC2 to 2.0.0-RC3.
That RC2..RC3 is quite small window. I almost forgot:
js...@google.com <js...@google.com> #20
Sorry for changing the component multiple times. :)
Finally, reproduced in Lifecycle lint's own test infra:
org.junit.ComparisonFailure: expected:<[No warnings.]> but was:<[src/Test.kt:8: Error: Expected non-nullable value [NullSafeMutableLiveData]
myData.value = data
~~~~
1 errors, 0 warnings]>
at org.junit.Assert.assertEquals(Assert.java:117)
at org.junit.Assert.assertEquals(Assert.java:146)
at com.android.tools.lint.checks.infrastructure.TestLintResult.expect(TestLintResult.kt:123)
at com.android.tools.lint.checks.infrastructure.TestLintResult.expect$default(TestLintResult.kt:96)
at com.android.tools.lint.checks.infrastructure.TestLintResult.expectClean(TestLintResult.kt:252)
at androidx.lifecycle.livedata.core.lint.NonNullableMutableLiveDataDetectorTest.lambdaParameterFromMediatorLiveData(NonNullableMutableLiveDataDetectorTest.kt:1076)
ap...@google.com <ap...@google.com> #22
Branch: androidx-main
commit 701b33868428d1d91109717be8c9a529e1e88e29
Author: Jinseong Jeon <jsjeon@google.com>
Date: Thu Jun 27 15:02:26 2024
Avoid conversion to UElement if possible
e.g., if resolved result can be used to find annotations
Bug: 341316048
Test: unit test added (currently failing with K2 UAST)
Change-Id: I64fdcc97e5411d6b86b691640e91f7e43ada4413
M lifecycle/lifecycle-livedata-core-lint/src/main/java/androidx/lifecycle/lint/NonNullableMutableLiveDataDetector.kt
M lifecycle/lifecycle-livedata-core-lint/src/test/java/androidx/lifecycle/livedata/core/lint/NonNullableMutableLiveDataDetectorTest.kt
js...@google.com <js...@google.com> #24
^ But, that doesn't mean we should wait for 243 merge into Studio (ETA: around the end of this year). I'm just waiting for 242 merge into Studio, and once it's done, I'll cherry-pick the fix such that this can be fixed in a month or two.
js...@google.com <js...@google.com>
js...@google.com <js...@google.com> #25
I accidentally left comments in a wrong tracker, like
I marked this fixed so that the bot can chime in and said which version contains the fix. I expect it to be 8.7.0-alpha04 (cut yesterday). Stay tuned; I have a repro project, so I'll try that myself as well.
js...@google.com <js...@google.com> #26
I can confirm that, by upgrading gradle to 8.8 and AGP to 8.7.0-alpha04, task :app:lintDebug
went well.
Description
Build #AI-241.15989.150.2412.11851376, built on May 16, 2024
Runtime version: 17.0.10+0--11609105 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 16
Registry:
debugger.watches.in.variables=false
analyze.exceptions.on.the.fly=true
ide.experimental.ui=true
ide.images.show.chessboard=true
Non-Bundled Plugins:
com.codeium.intellij (1.8.31)
dev.polek.adbwifi (1.2.5)
izhangzhihao.rainbow.brackets.lite (1.1.0)
com.jetbrains.packagesearch.intellij-plugin (241.0.9)
com.jetbrains.kmm (0.8.2(241)-3)
net.aquadc.mike.plugin (0.32)
org.jetbrains.compose.desktop.ide (1.6.2)
by.overpass.svg-to-compose-intellij (0.15)
com.github.copilot (1.5.4.5571)
call-graph (0.1.18)
```
C:\Users\Osanosa\AndroidStudioProjects\MyDropCompanion\app\src\main\java\pro\themed\mdvc\viewmodels\OrderListViewModel.kt:18: Error: Expected non-nullable value [NullSafeMutableLiveData from androidx.lifecycle]
_orders.value = data
~~~~
Explanation for issues of type "NullSafeMutableLiveData":
This check ensures that LiveData values are not null when explicitly
declared as non-nullable.
Kotlin interoperability does not support enforcing explicit
null-safety when using generic Java type parameters. Since
LiveData is a Java class its value can always be null even
when its type is explicitly declared as non-nullable. This can lead
to runtime exceptions from reading a null LiveData value that is
assumed to be non-nullable.
Vendor: Android Open Source Project
Identifier: androidx.lifecycle
Feedback:
1 errors, 0 warnings
```