Status Update
Comments
vi...@google.com <vi...@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
bo...@gmail.com <bo...@gmail.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'.
vi...@google.com <vi...@google.com>
je...@google.com <je...@google.com>
bo...@gmail.com <bo...@gmail.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
bo...@gmail.com <bo...@gmail.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.
eg...@gmail.com <eg...@gmail.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%):
ra...@gmail.com <ra...@gmail.com> #7
Over to Diego. We patched fieldDescriptor::reinitialize
-> InstanceKlass::field
-> FieldStreamBase::next
result in quadratic complexity iterating over the field stream.
a0...@gmail.com <a0...@gmail.com> #9
The fix for R class loading has been merged into M.1 and LB.2.
eg...@gmail.com <eg...@gmail.com> #10
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 Meerkat Feature Drop | 2024.3.2 Canary 3
- Android Gradle Plugin 8.10.0-alpha03
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!
ra...@gmail.com <ra...@gmail.com> #11
The fixes for this issue are now also available in:
- Android Studio Meerkat | 2024.3.1 RC 1
- Android Gradle Plugin 8.9.0-rc01
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
eg...@gmail.com <eg...@gmail.com> #12
The fixes for this issue are now also available in:
- Android Studio Ladybug Feature Drop | 2024.2.2 Patch 1
- Android Gradle Plugin 8.8.1
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
je...@google.com <je...@google.com> #13
je...@google.com <je...@google.com> #14
the BuildConfig.java is not generated any longer, we now generate the .class file directly.
the reason is that in case of pure kotlin project, we did not want to make it a mixed project with .java code that makes the kotlin compilation much slower (expecially with kapt).
can you verify that your BuildConfig.class is generated correctly ?
I have verified that the BuildConfig.class is generated and packaged with 4.1, 4.2 and master.
bo...@gmail.com <bo...@gmail.com> #15
I've tried with AGP 4.1.2
applicationVariants.all {
resValue("string", "app_name", "My App Name")
buildConfigField("String", "CUSTOM_VERSION_NAME", "\"0.0.1-custom\"")
}
This is not working. It creates the BuildConfig.java
without the CUSTOM_VERSION_NAME
and it doesn't create the gradleResValues.xml
file with the app_name
used in the AndroidManifest.xml
so it doesn`t compile.
I've tried changing it to the new onVariantProperties
like this:
onVariantProperties {
addResValue("app_name", "string", "My App Name", "")
addBuildConfigField("CUSTOM_VERSION_NAME", "\"0.0.1-custom\"", "")
}
Using onVariantProperties
the files BuildConfig.java
and gradleResValues.xml
are created as expected and the project builds successfully, creating also the BuildConfig.class
during the compilation.
je...@google.com <je...@google.com> #16
indeed, I can reproduce with the provided example. I have a fix already but I need to figure out why the groovy version of the same test did not fail. I suspect we will fix this in 4.2 and up since there is a work around. let me know if that works ?
thanks for the report and answering so fast !
je...@google.com <je...@google.com> #17
mystery solved. the code that you commented to make it work it actually configuring tasks as they are created (bad for build configuration time) and there was a bug in our code that did not expect it, so fix is going for review.
to...@gmail.com <to...@gmail.com> #18
Since this bug is referenced in AS 4.2 B5 changelog I fear that the fix did have some side effect on Android Wear unbundled.
Since devs are no more trusted to open issue at the proper place can you check
je...@google.com <je...@google.com> #19
#18, I do not believe it is related but I will ask someone to look at the other bug.
re...@gmail.com <re...@gmail.com> #20
ch...@gmail.com <ch...@gmail.com> #21
Android Studio Flamingo | 2022.2.1 Canary 9
AGP 8.0.0-alpha09
resValue("string", hello_world", "Hello world")
doesn't end up in final strings, gradleResValues.xml is also not generated.
Had issue with buildConfigField also but that got resolved with
buildFeatures {
buildConfig true
//resValues true < --- tried this to get resValue working but no success
}
Was working fine in Android Studio Flamingo | 2022.2.1 Canary 8 / AGP 8.0.0-alpha08
je...@google.com <je...@google.com> #22
#21 please file a new bug with a repro case. it's very unlikely to be the same cause.
Description
all required information.
Studio Build: Android Studio 4.1 Beta 4 #AI-201.7846.76.41.6667167, built on July 9, 2020
Version of Gradle Plugin: 4.1.0-beta04
Version of Gradle: 6.5.1
Version of Java: OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
OS: MacOS 10.15.6
Steps to Reproduce:
I have some customizations to the build script that where working fine with AGP 4.0.1 and they aren't working with AGP 4.1.0-beta04
I'm using the following block to add some resources and config fields at build time per variant
applicationVariants.all {
...
resValue("string", "app_name", appName.toString())
buildConfigField("CUSTOM_VERSION_NAME", buildVersionName)
}
fun BaseVariant.buildConfigField(name: String, value: String) = buildConfigField("String", name, "\"$value\"")
This is working in AGP 4.0.1 but using AGP 4.1.0-beta04 nor the app_name resource is added to resources nor the config field is added to BuildConfig.java