Fixed
Status Update
Comments
ni...@google.com <ni...@google.com> #2
There are two things that are happening here:
1. The error is saying that the attributes used were not defined, and they match exactly the error in b/136103084 - which leads me to believe that perhaps between the builds the gradle version was updated and that's why the bug in constraint layout surfaced.
2. Aapt2 stores the absolute path in the compiled resources for reporting errors. This is why the <CI workspace> path is shown since that was stored in the file. In order to fix this we need to make the input resource-sets to tasks that compile resources as PathSensitivity.ABSOLUTE. A better non-temporary fix would be to make aapt2 accept storing non-absolute paths and for us to figure out the proper error reporting ourselves.
For 1 follow b/136103084 , for 2 I'll do a temporary fix of using PathSensitivity.ABSOLUTE and I'll see what we can do to avoid storing the absolute paths.
1. The error is saying that the attributes used were not defined, and they match exactly the error in
2. Aapt2 stores the absolute path in the compiled resources for reporting errors. This is why the <CI workspace> path is shown since that was stored in the file. In order to fix this we need to make the input resource-sets to tasks that compile resources as PathSensitivity.ABSOLUTE. A better non-temporary fix would be to make aapt2 accept storing non-absolute paths and for us to figure out the proper error reporting ourselves.
For 1 follow
Description
ConstraintLayout version:
2.1.0-alpha2
Changing the
LayoutParams
of aConstraintLayout
child with a left/right margin does not update the views margins.When we set the layout params on the child (via
View.setLayoutParams
),androidx.constraintlayout.widget.ConstraintLayout.LayoutParams#resolveLayoutDirection
is called. At the very start of this method we assignoriginalLeftMargin/originalRightMargin
toleftMargin
/rightMargin
. Since the originals are 0 we reset the margin:I've attached a sample project. Pressing the button will crash the app due to failed assert on the margins (see
MainActivity
).Reverting to ConstraintLayout
2.1.0-alpha1
fixes the problem.