Fixed
Status Update
Comments
di...@google.com <di...@google.com> #2
Can you please help share the idea.log file (select Help > Show Log in Finder/Explorer) if this issue reproduces again? Thank you very much!
ch...@google.com <ch...@google.com> #3
Happened again, so here you go
ko...@gmail.com <ko...@gmail.com> #4
Thank you for your feedback. Team may reach out for more feedback in reproducing or triaging this issue.
ko...@gmail.com <ko...@gmail.com> #5
Upping Priority, as this may be a regression in 3.6.
ga...@gpeal.com <ga...@gpeal.com> #6
Yes -- this sounds similar to 138007389 which I've been running into repeatedly with 3.6 canaries.
ga...@gpeal.com <ga...@gpeal.com> #7
I get access denied trying to view that issue.
ra...@google.com <ra...@google.com> #8
Should be fixed in the upcoming 3.5 Beta 5.
jo...@gmail.com <jo...@gmail.com> #9
This issue is still present in 3.5 RC 2.
Here is a layout which uses a View in a ConstraintLayout as the background for a group. The View needs to be added to the layout before the views it draws behind. Reformat moves the view to a latter point in the layout, causing the background to be drawn above the other views.
Before and after reformat xml files are attached.
Here is a layout which uses a View in a ConstraintLayout as the background for a group. The View needs to be added to the layout before the views it draws behind. Reformat moves the view to a latter point in the layout, causing the background to be drawn above the other views.
Before and after reformat xml files are attached.
ni...@google.com <ni...@google.com>
jo...@gmail.com <jo...@gmail.com> #10
For further context, it seems this problem only happens if you are using a code style that was created from a previous version of Android Studio.
We defined a custom code style for our team when we were using Android Studio ~3.2.
I exported the default code style from Android Studio 3.5 RC2, and made the same changes, then set that as our new code style. This is working out well.
But the fix was not obvious. Both the legacy and the new code style xml files are attached.
If the IDE will not continue to behave as expected with an older code style, it should have some kind of detection and at least a warning for the developer. Ideally it would have an auto-fix that the developer can apply.
The most notable difference in the two styles is that the older style defined many more rules for arrangement of xml attributes.
We defined a custom code style for our team when we were using Android Studio ~3.2.
I exported the default code style from Android Studio 3.5 RC2, and made the same changes, then set that as our new code style. This is working out well.
But the fix was not obvious. Both the legacy and the new code style xml files are attached.
If the IDE will not continue to behave as expected with an older code style, it should have some kind of detection and at least a warning for the developer. Ideally it would have an auto-fix that the developer can apply.
The most notable difference in the two styles is that the older style defined many more rules for arrangement of xml attributes.
jo...@google.com <jo...@google.com> #11
Charlie is this a dupe of b/129323345 ?
[Deleted User] <[Deleted User]> #12
We've been investigating this based on #10, and found out the root cause of the issue. The arrangement rules in the codestyle now require the tag <XML_ATTRIBUTE /> in *all* blocks so they only reorder the attributes and not the tags. Adding this fixes the bug completely.
Exporting the code style with 3.5 changes some more things, but those seem to be unrelated to the bug. They look like default settings that have changed.
I'm attaching a screenshot of the diff for demonstration
Exporting the code style with 3.5 changes some more things, but those seem to be unrelated to the bug. They look like default settings that have changed.
I'm attaching a screenshot of the diff for demonstration
ch...@google.com <ch...@google.com>
an...@google.com <an...@google.com> #14
jo...@google.com <jo...@google.com> #15
3.5.1 includes a fix for this issue. Is anyone still experiencing this issue when upgrading to 3.5.1?
jo...@gmail.com <jo...@gmail.com> #16
I'll test the upgrade path again with 3.5.1 tomorrow.
ma...@gmail.com <ma...@gmail.com> #17
I just tried with 3.5.1 and did not experience the issue anymore. Thanks for fixing!
jo...@google.com <jo...@google.com>
lb...@gmail.com <lb...@gmail.com> #18
@17 How come I can still see it on Canary?
Android Studio 4.0 Canary 1
Build #AI-192.6817.14.36.5959023, built on October 23, 2019
Android Studio 4.0 Canary 1
Build #AI-192.6817.14.36.5959023, built on October 23, 2019
lb...@gmail.com <lb...@gmail.com> #19
OK I tried again this issue on 3.5.2 . Still seeing it.
Why is this fixed?
I can still see this on this version too.
Attached video.
Why is this fixed?
I can still see this on this version too.
Attached video.
lb...@gmail.com <lb...@gmail.com> #20
I think this is a duplicate of an issue I've reported about, here:
https://issuetracker.google.com/issues/129362498
https://issuetracker.google.com/issues/130630671
Please merge those.
In any case, this issue is NOT fixed. Not on stable 3.5.2 and not on 4.0 canary 1
Please merge those.
In any case, this issue is NOT fixed. Not on stable 3.5.2 and not on 4.0 canary 1
ra...@google.com <ra...@google.com> #21
When you go to Settings and navigate to Editor > Code Style > XML, how do the arrangement rules look like? I've attached mine as an example.
The fix we mentioned in the release notes edits the code style settings to add the 'attribute' type to each rule, so that they won't match entire tags, only attributes should get re-ordered. You can also fix this manually in the settings page, by selecting "Set From.." > Predefined Style > Android. I'd like to understand what happened to your code style settings such that the fix was not applied automatically.
The fix we mentioned in the release notes edits the code style settings to add the 'attribute' type to each rule, so that they won't match entire tags, only attributes should get re-ordered. You can also fix this manually in the settings page, by selecting "Set From.." > Predefined Style > Android. I'd like to understand what happened to your code style settings such that the fix was not applied automatically.
lb...@gmail.com <lb...@gmail.com> #22
@21 Guys I've reported this ages ago. It occurs on 2 different PCs (desktop at home, laptop at the office) with different configurations.
Here, attached what I see there on my PC at home.
What difference does it make to have a different style than yours?
It should never ever change the order of XML tags. No matter how weird the style is for you.
Here, attached what I see there on my PC at home.
What difference does it make to have a different style than yours?
It should never ever change the order of XML tags. No matter how weird the style is for you.
ra...@google.com <ra...@google.com> #23
What is the "Default" IDE code style? The project one looks fine, I have the same settings as you do and the "uses-permission" tag in a manifest does not get reordered ( I just tried Studio 3.5.2).
lb...@gmail.com <lb...@gmail.com> #24
@23 I wish Android Studio was completely portable with all of its files that I could just send you.
Is there a way I can send you just these relevant settings? I tried now. Hope it is what you want.
And again, why do you care about the code style? No matter how weird I set the settings, changing the order of the XML tags is wrong. It ruins stuff on layout files and on manifest and maybe on others too .
I reported about this issue a very long time ago. I even stayed with stable version because of it (as it occurred on canary in the beginning).
You could have compared between what happened on the version I've found out, and a version that didn't have this issue.
Now no matter which version I use of the IDE, it can occur.
A workaround is to sometimes change the code style profile back and forward, but for a new project (and when opening existing ones that were never opened) there is always a chance for it to occur again.
Is there a way I can send you just these relevant settings? I tried now. Hope it is what you want.
And again, why do you care about the code style? No matter how weird I set the settings, changing the order of the XML tags is wrong. It ruins stuff on layout files and on manifest and maybe on others too .
I reported about this issue a very long time ago. I even stayed with stable version because of it (as it occurred on canary in the beginning).
You could have compared between what happened on the version I've found out, and a version that didn't have this issue.
Now no matter which version I use of the IDE, it can occur.
A workaround is to sometimes change the code style profile back and forward, but for a new project (and when opening existing ones that were never opened) there is always a chance for it to occur again.
lb...@gmail.com <lb...@gmail.com> #25
@23 BTW, the reason I even change the style is that the IDE moved to a style that liked to word wrap very easily.
On Kotlin it is really terrible (flag that causes these issues is "kotlin.code.style=official"). On XML, I just prefer not to have a single attribute per line, because that makes it harder to see multiple child views, and thus seeing the hierarchy in XML style.
It's nice that you put an effort in the layout designer, but I prefer handling the XML editor instead. I use the designer only to see that what I did seems fine, before I run the app.
On Kotlin it is really terrible (flag that causes these issues is "kotlin.code.style=official"). On XML, I just prefer not to have a single attribute per line, because that makes it harder to see multiple child views, and thus seeing the hierarchy in XML style.
It's nice that you put an effort in the layout designer, but I prefer handling the XML editor instead. I use the designer only to see that what I did seems fine, before I run the app.
ra...@google.com <ra...@google.com> #26
Hm, it looks like you're using either the "Default" or the "Default_1" code style, not the Project-level one. Because both of them have the broken arrangement settings missing the <XML_ATTRIBUTE /> tags:
...
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
...
Each rule should match on attributes only, i.e. the above snippet should look like:
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
The code style matters here because these broken XML arrangement settings are matching tags, not only attributes, and that's why Studio ends up re-ordering the tags in the entire file. The matching rules should filter attributes only.
The way to manually fix it is to select the Default or Default_1 code style and re-apply the Android settings: "Set From.." > Predefined Style > Android. You can double-check it worked if you see the attribute matchers, just like I have it in the screenshot in #21, or alternatively look inside the code style files for <XML_ATTRIBUTE /> being added to all rules.
...
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
...
Each rule should match on attributes only, i.e. the above snippet should look like:
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
The code style matters here because these broken XML arrangement settings are matching tags, not only attributes, and that's why Studio ends up re-ordering the tags in the entire file. The matching rules should filter attributes only.
The way to manually fix it is to select the Default or Default_1 code style and re-apply the Android settings: "Set From.." > Predefined Style > Android. You can double-check it worked if you see the attribute matchers, just like I have it in the screenshot in #21, or alternatively look inside the code style files for <XML_ATTRIBUTE /> being added to all rules.
lb...@gmail.com <lb...@gmail.com> #27
@26 Guys please just fix this issue. I tried a lot of things. All that I tried are only temporary. Sooner or later this issue occurs again.
lb...@gmail.com <lb...@gmail.com> #28
@26 The issue sometimes occurs even with a new project, which chooses "project" by default.
Also, there is no "set from" option anywhere.
Please explain what to do as a workaround, including how to disable the "kotlin.code.style=official" flag once and for all .
Also, there is no "set from" option anywhere.
Please explain what to do as a workaround, including how to disable the "kotlin.code.style=official" flag once and for all .
lb...@gmail.com <lb...@gmail.com> #29
@26 Here, for a new project, that chose "project", it still occur.
ch...@gmail.com <ch...@gmail.com> #30
I updated to 3.6.2 earlier today, all fresh and excited to start a new project. Now I'm barely holding my eyelids open, after finally figuring out why the sample navigation drawer activity template was not switching the fragments. Definitely not fixed. Hopefully I will get something useful done tomorrow.
Android Studio 3.6.2
Build #AI-192.7142.36.36.6308749, built on March 19, 2020
Runtime version: 1.8.0_212-release-1586-b4-5784211 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.3.11-200.fc30.x86_64
GC: ParNew, ConcurrentMarkSweep
Memory: 1246M
Cores: 4
Registry: ide.new.welcome.screen.force=true
Non-Bundled Plugins:
Android Studio 3.6.2
Build #AI-192.7142.36.36.6308749, built on March 19, 2020
Runtime version: 1.8.0_212-release-1586-b4-5784211 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.3.11-200.fc30.x86_64
GC: ParNew, ConcurrentMarkSweep
Memory: 1246M
Cores: 4
Registry: ide.new.welcome.screen.force=true
Non-Bundled Plugins:
pa...@gmail.com <pa...@gmail.com> #31
I think you should open a new issue, as far as I know, they don't monitor resolved issues.
lb...@gmail.com <lb...@gmail.com> #32
Even when I don't see this issue, I still see Kotlin formatting issues. It keeps formatting in a way that likes word-wrapping too much.
Description
Android Studio 3.5 Canary 8
Build #AI-191.6014.8.35.5375575, built on March 14, 2019
JRE: 1.8.0_152-release-1343-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.3
Libraries used: N/A
With the latest Canary 8, when reformatting an xml layout, the order of the elements is not respected.
Please see example in attached video.