Status Update
Comments
cj...@google.com <cj...@google.com> #2
This one is beginning to be severe, after updating Kotlin to 1.6.0-RC2 the incidents have become more frequent (I hope they aren't related).
The only remedy is still to restart AS.
Still in Chipmunk 2021.2.1.3
va...@google.com <va...@google.com> #3
Hi Roar, thank you for the report. I see a few other similar looking bug reports so I'll prioritize this.
Please let me know if you notice a pattern in which the incidents happen.
ma...@google.com <ma...@google.com> #4
Roar, I tried playing with a small data binding project and I couldn't reproduce the issue. Do you know what triggers it? Like after a refactoring or some other action? A sample project would be very helpful to us too.
ap...@google.com <ap...@google.com> #5
office and one HP i5/16GB at home office, sme kotlin based project.
Happens mostly when changing binding related code like adding data members
in xml layouts, but also just out og the blue when opening code with
fragments and data bindings.
I'll send you an collection of my logs tomorrow.
I have experienced similar issues (approx 2-3 years ago, then I asked for a
"regenerate bindings"-button, but it was "pinned down" then (no hard
feelings for that then :) ).
BTW I have seen this issue sporadicly, but then I could click
Build->Generate sources gradle tasks to fix it, but now it will not fix it.
tor. 4. nov. 2021, 21:47 skrev <buganizer-system@google.com>:
bl...@google.com <bl...@google.com> #6
For the time being, you can get the binding back by going Build > Clean Project
instead of restarting Studio.
bl...@google.com <bl...@google.com> #7
aj...@google.com <aj...@google.com> #8
Good tip, I'll try that next time.
I am providing my zipped logged directory, so you have something to work on.
Pls send me an pm/email if you need access to the project.
RG
aj...@google.com <aj...@google.com> #9
well, it just happened again here. I'm now on
Android Studio Chipmunk | 2021.2.1 Canary 4 Build #AI-212.5284.40.2112.7863073, built on October 28, 2021 Runtime version: 11.0.12+7-b1504.28-7817840 amd64 VM: OpenJDK 64-Bit Server VM by Oracle Corporation Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 1280M Cores: 8 Registry: external.system.auto.import.disabled=true
With gradle set to using my system default JDK: openjdk version "17" 2021-09-14 OpenJDK Runtime Environment (build 17+35-2724) OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)
and my project set to compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 coreLibraryDesugaringEnabled true }
Everything was fine until I started editing my styles; individual style.xml files and some attributes set in layouts. Don't think it matters, but I was editing 'textColor' attributes specifically; NOT adding or removing any elements. Running the app in the emulator in debug mode (but not actively using the debugger). Out of the blue, a java file I had open lost its view binding. Every other such file I open subsequently lost its vb. Looking in the 'generated' folder, all vb files are present and correct.
Dunno if it's relevant, but here is the idea.log from the timeframe:
2021-11-11 12:03:29,495 [5901837] INFO - .idea.res.ResourceUpdateTracer - Unresolved resource reference "@attr/colorOnBackgroun" in fastscroller\src\main\res\drawable\fastscroll_overlay_classic.xml
--- Resource update trace: ---
2021-11-11 12:03:29.495
2021-11-11 12:03:29,495 [5901837] INFO - .idea.res.ResourceUpdateTracer - Unresolved resource reference "@attr/colorOnBackgroun" in fastscroller\src\main\res\drawable\fastscroll_overlay_classic.xml
--- Resource update trace: ---
2021-11-11 12:03:29.495
2021-11-11 12:03:29,994 [5902336] ERROR - GradleBuildOutputUtil.kt - Exception 'java.lang.Throwable: Output listing build file is not available for output type Apk in IdeBuildTasksAndOutputInformationImpl(assembleTaskName=assembleDebug, assembleTaskOutputListingFile=null, bundleTaskName=null, bundleTaskOutputListingFile=null, apkFromBundleTaskName=null, apkFromBundleTaskOutputListingFile=null)' was reported 40 times 2021-11-11 12:03:36,955 [5909297] WARN - itors.literals.LiteralsManager - Only Kotlin is supported for LiveLiterals 2021-11-11 12:04:00,136 [5932478] WARN - itors.literals.LiteralsManager - Only Kotlin is supported for LiveLiterals 2021-11-11 12:04:00,464 [5932806] WARN - itors.literals.LiteralsManager - Only Kotlin is supported for LiveLiterals 2021-11-11 12:04:24,029 [5956371] WARN - itors.literals.LiteralsManager - Only Kotlin is supported for LiveLiterals 2021-11-11 12:04:46,179 [5978521] INFO - gs.CompletionMLRankingSettings - ML Completion enabled, experiment group=13 for: C/C++ 2021-11-11 12:04:46,179 [5978521] INFO - gs.CompletionMLRankingSettings - ML Completion enabled, experiment group=11 for: Kotlin 2021-11-11 12:04:46,240 [5978582] INFO - rationStore.ComponentStoreImpl - Saving Project(name=NeverTooManyBooks, containerState=COMPONENT_CREATED, componentStore=C:\Data\Code\NeverTooManyBooks)VcsDirectoryMappings took 18 ms 2021-11-11 12:04:55,595 [5987937] INFO - rationStore.ComponentStoreImpl - Saving Project(name=NeverTooManyBooks, containerState=COMPONENT_CREATED, componentStore=C:\Data\Code\NeverTooManyBooks)RenderSettings took 13 ms 2021-11-11 14:45:48,438 [15640780] INFO - rationStore.ComponentStoreImpl - Saving Project(name=NeverTooManyBooks, containerState=COMPONENT_CREATED, componentStore=C:\Data\Code\NeverTooManyBooks)GradleMigrationSettings took 29 ms 2021-11-11 14:45:58,299 [15650641] WARN - itors.literals.LiteralsManager - Only Kotlin is supported for LiveLiterals 2021-11-11 14:46:03,672 [15656014] WARN - itors.literals.LiteralsManager - Only Kotlin is supported for LiveLiterals 2021-11-11 14:46:38,793 [15691135] INFO - System.impl.PopupMenuPreloader - Popup menu 'Project View Popup Menu' preloaded at 'ProjectViewPopup' in 9 ms 2021-11-11 14:46:38,794 [15691136] INFO - System.impl.PopupMenuPreloader - Popup menu 'Project View Popup Menu' preloaded at 'ProjectViewPopup' in 9 ms 2021-11-11 14:46:47,988 [15700330] WARN - itors.literals.LiteralsManager - Only Kotlin is supported for LiveLiterals 2021-11-11 14:46:58,912 [15711254] WARN - itors.literals.LiteralsManager - Only Kotlin is supported for LiveLiterals 2021-11-11 14:48:08,870 [15781212] INFO - rationStore.ComponentStoreImpl - Saving appwhatsNew took 15 ms 2021-11-11 14:49:33,474 [15865816] WARN - itors.literals.LiteralsManager - Only Kotlin is supported for LiveLiterals 2021-11-11 14:52:51,578 [16063920] INFO - gs.CompletionMLRankingSettings - ML Completion enabled, experiment group=13 for: C/C++ 2021-11-11 14:52:51,578 [16063920] INFO - gs.CompletionMLRankingSettings - ML Completion enabled, experiment group=11 for: Kotlin 2021-11-11 14:56:07,503 [16259845] INFO - j.ide.actions.RevealFileAction - Exit code 1
again, not sure if it's relevant/related, but the "@attr/colorOnBackgroun" mentioned above is in fact ""?attr/colorOnBackground" (with a '?' and a 'd' at the end) in my code.
ll...@google.com <ll...@google.com> #10
Reporting my last "crashes" with bindings.
ry...@google.com <ry...@google.com> #11
ok... I'm now having to quit/restart studio after every layout edit
I basically have a bunch of layouts with the outer tag a ConstraintLayout. I'm copy/pasting a new root tag CoordinatorLayout in all of them. So for each file, I paste the new CoordinatorLayout top section, remove the namespace declaration from the ConstraintLayout and finally close the CoordinatorLayout tag at the bottom of the file. Now open the java file... yup... bindings are lost; restart Studio.
Edit: each layout is present twice: portrait + "land"
aj...@google.com <aj...@google.com> #12
Please se #6 above for short remedy.
bl...@google.com <bl...@google.com> #13
sure I saw #6; but for me restarting Studio is faster then a 'clean' and subsequent full-build.
I can't tell for sure (yet) but it seems to happen most/only when editing layouts which exist in both portrait + "land"
aj...@google.com <aj...@google.com> #14
Thanks for the updates guys and keep them coming.
FYI our team is stretched thin and with the holidays on the horizon, I don't think we can get to this until a few weeks from now. I do want to get this fixed for Android Studio Chipmunk. Thanks for your patience.
in...@google.com <in...@google.com> #15
I'm trying to get this 100% reproducible. Let me know if there are any extra debug flags that you want me to set.
in...@google.com <in...@google.com> #16
I now feel strongly for a "recalculate bindings button" or menu point.
in...@google.com <in...@google.com> #17
BTW, Clean Project mentioned in #6 doesn't always remedy.
I want to refer other issues where I have had similar problems:
Attaching logs.
aj...@google.com <aj...@google.com> #18
It is more likely to happen while you are building your project.
in...@google.com <in...@google.com> #19
2021-11-28 22:24:40,850 [1307885] WARN - .caches.project.IdeaModuleInfo - Could not find correct module information. Reason: Analyzing element of type class com.android.tools.idea.databinding.psiclass.LightBrClass$LightBRField with no containing file Text: public static final int tileProviderName;
I think this points to the cause of the issue. I was able to reproduce the same warning message by adding another DB variable to the layout.
aj...@google.com <aj...@google.com> #20
Less likely before build, most likely during and after build.
va...@google.com <va...@google.com> #21
Upgraded to Kotlin plugin "212-1.6.10-RC-release-906-AS5457.46", still same issues occurres (if that should have any influence).
gb...@google.com <gb...@google.com> #22
Android Studio Chipmunk | 2021.2.1 Canary 6
Build #AI-212.5457.46.2112.7968471, built on December 3, 2021
Runtime version: 11.0.12+7-b1504.28-7817840 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 6144M
Cores: 8
Registry: analyze.exceptions.on.the.fly=true, external.system.auto.import.disabled=true, documentation.show.toolbar=true
Non-Bundled Plugins: CMD Support (1.0.5), com.intellij.ideolog (203.0.27.0), org.intellij.plugins.markdown (212.5457.16), PythonCore (212.5457.59), CheckStyle-IDEA (5.59.1), com.google.mad-scorecard (1.2)
gb...@google.com <gb...@google.com> #23
aj...@google.com <aj...@google.com> #24
To me it happens a lot, it's frustrating.
Almost every time I change some IDs in XML.
Every time I build after I change something in local.properties (I have some configuration properties there, API base URL, secrets, stuff like that).
Happens on kotlin source code, happens on java source code.
Android Studio Chipmunk | 2021.2.1 Canary 7
Build #AI-212.5457.46.2112.8043657, built on January 5, 2022
Runtime version: 11.0.12+7-b1504.28-7817840 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 12
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: Rider UI Theme Pack (0.10.1), Dart (212.5632), io.flutter (63.3.3)
aj...@google.com <aj...@google.com> #25
Update: I have found the cause of this issue and it's likely a regression caused by refactoring of Studio's resource repository system last year. The TL;DR explanation is data binding backend stopped getting updates from the resources repositories (ie: when you add/remove something to the layout xml), and stopped maintaining in-memory objects of the views or at least supplied stale objects to the IDE.
I'm collaborating with other teams to get the proper fix in, hopefully cherrypicked for CM beta 3.
rr...@google.com <rr...@google.com> #26
Fix is in for Dolpha Canary 3. Waiting for cherry pick into CM beta 3.
va...@google.com <va...@google.com> #27
Fix is cherry picked into CM beta 3.
aj...@google.com <aj...@google.com> #28
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 Dolphin Canary 2 (2021.3.1.2)
- Android Gradle Plugin 7.3.0-alpha02
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!
ap...@google.com <ap...@google.com> #29
Adequate feedbacks do always lead to a better product!!
I hope ours have helped.
BTW: Do AGP v7.4 contain this fix ?
aj...@google.com <aj...@google.com> #30
Yes your feedback has certainly helped!
The fix is in Studio in the above versions. It's not related to AGP (compilation has always worked fine).
bu...@google.com <bu...@google.com> #31
Note !
I see intermediate lost bindings, especially when (sometimes) doing changes to xml scheme and when (everytime) after updating project to new AS version (in this particular situation Dolphin Canary 7)
see picture.
Attaching logs.
aj...@google.com <aj...@google.com> #32
We are still loosing bindings: This time in this configuration:
Build: AI-213.7172.25.2113.8421465, 202204072206,
AI-213.7172.25.2113.8421465, JRE 11.0.13+0-b1751.21-8125866x64 JetBrains s.r.o., OS Windows 11(amd64) v10.0 , screens 2400.0x1350.0, 1920.0x1080.0, 1920.0x1080.0, 768.0x1366.0
AS: Dolphin | 2021.3.1 Canary 8; Kotlin plugin: 213-1.6.20-M1-release-205-AS6777.52; Android Gradle Plugin: 7.3.0-alpha08; Gradle: 7.4.2; Gradle JDK: version 11.0.13; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
This time it happened moments after changing corresponding xml file. Normally I see intermediate loss, and it regains in 10-15 secs, but this time it stays put.
c-...@google.com <c-...@google.com>
ma...@google.com <ma...@google.com>
aj...@google.com <aj...@google.com> #33
I tried to reproduce this issue on a small project using the steps that worked before, but no luck so far. I might need to use your big project again.
In the mean time, if you have accurate repro steps, please provide them here. Thanks!
ma...@google.com <ma...@google.com> #34
Please send me a PM...
aj...@google.com <aj...@google.com> #35
Just adding another incident, occures most likely after editing an xml layout file, and after you have made a compile/build/run.
c-...@google.com <c-...@google.com> #36
Loosing Bindings are becoming more severe i Dolphin Beta 1, especially when editing XML files.
aj...@google.com <aj...@google.com> #37
May this also be related to loosing bindings.
Suddenly new android:id="@+id/id_name"
aren't created either.
Building the project will create them. That's unusual.
tb...@google.com <tb...@google.com> #38
Could you please describe the problem with android:id="@+id/id_name"
in greater detail. Thank you.
aj...@google.com <aj...@google.com> #39
Sometimes when editing xmls and adds a view and adds an androi:id element or edits an existing android:id (and use @+id) the id name is marked with red with complaints that the id name is not found or doesn't exist. I expects the id to be created silently. If I compile/run my app the red marking seems to disappear and id is created.
rr...@google.com <rr...@google.com> #40
Could you please enable Help > Diagnostic Tools > Trace Resource Updates, close and reopen the project, wait until you see an unresolved android:id="@+id/id_name"
and attach a fresh idea.log to this bug. Thank you.
aj...@google.com <aj...@google.com> #41
va...@google.com <va...@google.com> #42
#40 Tried to enable your suggested setting, but the IDE got so sluggish and slow that I needed to disabled it again.
But I got another lost binding issue, when editing the xmls for some settings view in the xml path, so it is not aimed just to the xmls in the layot path.
I'll do a second attempt to enable it again...
aj...@google.com <aj...@google.com> #43
Actually got an list binding fail in the middle of both xml changes and code writing.
Adding what I got (not actually what you need, but here's something).
The android:id's and android:keys and strings seems fine now though.
aj...@google.com <aj...@google.com> #44
ap...@google.com <ap...@google.com> #45
...and
aj...@google.com <aj...@google.com> #46
Update: I spent several hours trying to reproduce this issue using your project Norva24 MSlam
but no luck again. I have tried adding new views, renaming view ids, adding/removing data variables. Building the project from time to time.
The fact that we haven't received new bug reports about losing bindings (unlike last time) makes me think this is an isolated issue. Data binding is deeply integrated into intellij and has to respect its contracts, for example we avoid computation when intellij is indexing. You mentioned before that it takes ~15 seconds for bindings to reappear so it's taking a long time to compute bindings (Your project has a large number of layout xmls!). It could be the case that your project is exceeding what data binding can handle given your system resources. I know this is an unsatisfying explanation, but I don't have much to go on right now.
in...@google.com <in...@google.com> #47
to report now & then, and maybe sometime wi will prevail...
man. 16. mai 2022, 19:58 skrev <buganizer-system@google.com>:
aj...@google.com <aj...@google.com> #48
It is more likely to happen when, and after you have changed XML files.
And it would have been very convenient to have a simple recalculate
bindings menu item.
man. 16. mai 2022, 22:28 skrev Roar Grønmo <roar.gronmo@gmail.com>:
in...@google.com <in...@google.com> #49
Well, I've seen it happen less, but just now... kaboom...
Android Studio Chipmunk | 2021.2.1 Build #AI-212.5712.43.2112.8512546, built on April 28, 2022 Runtime version: 11.0.12+7-b1504.28-7817840 amd64 VM: OpenJDK 64-Bit Server VM by Oracle Corporation Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 3072M Cores: 8 Registry: external.system.auto.import.disabled=true Non-Bundled Plugins: org.jetbrains.kotlin (212-1.6.21-release-334-AS5457.46)
-
opened a layout file which has a series of buttons in a contraint layout one below the other (like a menu)
-
removed a button from a contraintlayout
-
corrected the button below to have its topToBottomOf point to its new 'upstairs' neighbour.
-
closed xml
-
in the java file, removed the same button which I had an onclicklistener on:
vb.myButton.setOnClickListener(v -> { ...});
-
all was well.
-
in that same java file, changed a string resource R.string.something to R.string.new_res with the "new_res" not existing
-
used context menu to add the 'new_res' via the dialog box.
-
clicked ok to save that res.
-
lost the bindings.
-
idea.log attached
-
good luck!
aj...@google.com <aj...@google.com> #50
Android Studio Dolphin Beta. To me, it happen again yesterday. Did some xml changes, lost binding class. Afterbuilding the project, the IDE was able to see the binding class again.
You're making progress, but you're not there yet. bindings are getting lost more rarely. And when they get lost, I just need to hit build. On previous versions it was horrible, bindings were lost on each xml modification. And the only solution was to invalidate caches and restart.
gb...@google.com <gb...@google.com> #51
Issue referenced in this log, I didn't do any changes to the XMLs, just my kotlin code.
EE C2
rr...@google.com <rr...@google.com> #52
Still a problem in AS EE C5 This time it happened after editing a XML file. (editing a color reference in a xml view)
gb...@google.com <gb...@google.com> #53
Here's one which just appeared "out of the blue".
Was checking my email on my phone(!), and in the corned of my eye (after approx 2 mins of no action on the computer) suddenly the IDE lost all bindings.
aj...@google.com <aj...@google.com> #54
guys please test on Windows OS. I switched to macOS and it never happened again so far. probably has something to do with some lower level API works, there are small differences on Windows, say, on filesystem notifier.
gb...@google.com <gb...@google.com> #55
I see this one is marked as fixed but it sure looks like the same issue I just reported using 'Android Studio Dolphin | 2021.3.1 Beta 4' on a Macbook Air.
bu...@google.com <bu...@google.com> #56
Here we go again, I upgraded to new machine with Windows 11 and Dolphin beta 5:
Android Studio Dolphin | 2021.3.1 Beta 5 Build #AI-213.7172.25.2113.8774922, built on June 28, 2022 Runtime version: 11.0.13+0-b1751.21-8125866 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 4096M Cores: 20 Registry: external.system.auto.import.disabled=true ide.text.editor.with.preview.show.floating.toolbar=false
Non-Bundled Plugins: CheckStyle-IDEA (5.68.0) org.jetbrains.plugins.spotbugs (1.2.5) cn.yiiguxing.plugin.translate (3.3.4)
No new messages in idea.log this time
ap...@google.com <ap...@google.com> #57
Hi, we got this issue as well when editing layout.
2022-07-27 10:45:47,050 [35160958] WARN - .caches.project.IdeaModuleInfo - Could not find correct module information. Reason: Analyzing element of type class com.android.tools.idea.databinding.psiclass.LightBrClass$LightBRField with no containing file Text: public static final int viewModel; 2022-07-27 10:45:47,054 [35160962] WARN - .caches.project.IdeaModuleInfo - Could not find correct module information. Reason: Analyzing element of type class com.android.tools.idea.databinding.psiclass.LightBrClass$LightBRField with no containing file Text: public static final int viewModel; 2022-07-27 10:45:47,589 [35161497] WARN - .caches.project.IdeaModuleInfo - Could not find correct module information. Reason: Analyzing element of type class com.android.tools.idea.databinding.psiclass.LightBrClass$LightBRField with no containing file Text: public static final int viewModel; 2022-07-27 10:45:47,591 [35161499] WARN - .caches.project.IdeaModuleInfo - Could not find correct module information. Reason: Analyzing element of type class com.android.tools.idea.databinding.psiclass.LightBrClass$LightBRField with no containing file
can you help confirm the fix is also available on Chipmunk patch 2 or patch 3? or should we use dolphin ?
Description
LUCI:https://ci.chromium.org/ui/p/chromeos/builders/general/Full/b8832798635474514769/overview