Status Update
Comments
sp...@google.com <sp...@google.com>
di...@google.com <di...@google.com>
ps...@google.com <ps...@google.com>
jl...@google.com <jl...@google.com> #2
1. Android Studio version and OS type and version
2. Screenshots or videos of the issue
3. idea.log file (select Help > Show Log in Finder / Explorer)
4. Thread dumps if the issue is a freezing or non-responding UI.
For more information on what’s needed and how to obtain this information please read the guide at
sa...@squareup.com <sa...@squareup.com> #3
Please find the required data below: Android Studio version: Android Studio Ladybug Feature Drop | 2024.2.2 OS type and version: Microsoft Windows 10 Pro (10.0.19045 Build 19045)
I didn't have screenshots now. The issue I faced is that, when changing some code in the XML file, it take more time to reflect in the preview than usual. And sometimes, after opening the project, the preview takes more time to load and shows a loader with message 'Initializing'.
jl...@google.com <jl...@google.com> #4
There is a frequent exception logged as a warning, in conjunction with "Recomputed N fields for..." logging (sometimes duplicated for the same fqn? see the 464 fields below):
2025-01-09 18:20:05,404 [28441383] INFO - #o.j.a.a.InnerRClassBase - Recomputed 987 fields for ResourceRepositoryInnerRClass{fqn=com.sensei.engrow.R.string, repository=AppResourceRepository@709C7B72}
2025-01-09 18:20:19,922 [28455901] INFO - #com.android.ddmlib - Device 'motorola-moto_g52-ZD22262ND3' jdwp process '17149' is now known as pkg='com.sensei.engrow.alpha.ro.debug' (proc='com.sensei.engrow.alpha.ro.debug')
2025-01-09 18:23:02,900 [28618879] INFO - #o.j.a.a.InnerRClassBase - Recomputed 464 fields for ResourceRepositoryInnerRClass{fqn=com.sensei.engrow.R.layout, repository=AppResourceRepository@709C7B72}
2025-01-09 18:23:02,906 [28618885] INFO - #o.j.a.a.InnerRClassBase - Recomputed 464 fields for ResourceRepositoryInnerRClass{fqn=com.sensei.engrow.R.layout, repository=AppResourceRepository@573BFD3D}
2025-01-09 18:23:02,908 [28618887] INFO - #o.j.a.a.InnerRClassBase - Recomputed 169 fields for ResourceRepositoryInnerRClass{fqn=com.sensei.engrow.test.R.layout, repository=TestAppResourceRepository@13D0D7B5}
2025-01-09 18:23:03,284 [28619263] INFO - #c.i.d.JVMResponsivenessMonitor - JVM responsiveness: {avg: 2520.7322222222224, 50%: 1900, 99%: 15303, 99.9%: 26911, max: 35327 }ns, x{3600 measurements}
2025-01-09 18:23:20,756 [28636735] WARN - #o.j.k.i.b.p.ModuleInfoProvider - Could not find correct module information
org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments: Analyzing element of type class com.intellij.psi.impl.source.PsiJavaFileImpl in non-physical file of type class com.intellij.psi.impl.source.PsiJavaFileImpl
at org.jetbrains.kotlin.idea.base.projectStructure.ModuleInfoProvider.collectByElement(ModuleInfoProvider.kt:193)
at org.jetbrains.kotlin.idea.base.projectStructure.ModuleInfoProvider.access$collectByElement(ModuleInfoProvider.kt:73)
at org.jetbrains.kotlin.idea.base.projectStructure.ModuleInfoProvider$collect$1.invoke(ModuleInfoProvider.kt:108)
at org.jetbrains.kotlin.idea.base.projectStructure.ModuleInfoProvider$collect$1.invoke(ModuleInfoProvider.kt:107)
at org.jetbrains.kotlin.idea.base.util.SeqKt$seq$$inlined$Sequence$1.iterator(Sequences.kt:682)
at org.jetbrains.kotlin.idea.base.projectStructure.ModuleInfoProviderKt$unwrap$1$iterator$1.<init>(ModuleInfoProvider.kt:488)
at org.jetbrains.kotlin.idea.base.projectStructure.ModuleInfoProviderKt$unwrap$1.iterator(ModuleInfoProvider.kt:487)
at kotlin.sequences.SequencesKt___SequencesKt.firstOrNull(_Sequences.kt:167)
at org.jetbrains.kotlin.idea.base.projectStructure.ModuleInfoProviderUtils.firstOrNull(ModuleInfoProviderUtils.kt:43)
I suspect the non-physical PsiJavaFileImpl is an R class. I found
As for preview rendering, I tried opening four layout files from Signal-Android and the majority of time is spent in reflection:
Eugene, do you know which JBR has the fix for
sa...@squareup.com <sa...@squareup.com> #5
It was only 21.0.3b509.4 version with a fix: from Ladybug.1 Canary 1 till Canary 8
We lost patch in subsequent JBR update. ouch.
jl...@google.com <jl...@google.com> #6
PS. Here's the async-profiler flame graph of the same:
FieldStreamBase::next
calls, as a result of upstream commit
In the above flame graph, loadIdsFromResourceClass
has 26,531 CPU samples (42.19%). Here's the same code running on JBR17, only 3,010 CPU samples (8.81%):
sa...@squareup.com <sa...@squareup.com> #7
Over to Diego. We patched fieldDescriptor::reinitialize
-> InstanceKlass::field
-> FieldStreamBase::next
result in quadratic complexity iterating over the field stream.
an...@google.com <an...@google.com> #9
The fix for R class loading has been merged into M.1 and LB.2.
Description
When Android Studio fails to download the necessary dependencies for inspecting composable layouts, it displays this suggestion for adding a custom VM property:
However, adding the property results in another error:
STEPS TO REPRODUCE:
-Dappinspection.use.dev.jar=true