constraintlayout icon indicating copy to clipboard operation
constraintlayout copied to clipboard

Constraint Layout flow broken with android.experimental.enableNewResourceShrinker.preciseShrinking=true

Open Tolriq opened this issue 4 years ago • 4 comments

Posted on AndroidStudio issue tracker but also posting here in case the layout have a problem and works by luck and not proper design.

https://issuetracker.google.com/issues/206655918

Layout is attached here.

include_remote_control.zip

Can you confirm the layout is correct and the issue is 100% on AGP side, or is the layout not proper and AGP may just make the underlying issue visible?

Tolriq avatar Nov 17 '21 12:11 Tolriq

So this is due to again constraint_referenced_ids not being handled by the tool and so ignoring those ids as being used.

Since the issue I created on the tracker have no default assignee I fear it won't be assigned / triaged, would be nice if you know how to ping the proper people about that.

Tolriq avatar Nov 17 '21 14:11 Tolriq

This is probably related to the new experimental ResourceShrinker

Tip on things you can do to help get fixes the fastest.

  1. Include the component name you think is broken in the title - (AGP ResourceShrinker broken with ConstraintLayout Flow)
  2. include a picture of what it should look like - so we know what changed
  3. Create a standalone application that replicates the problem 4, Reduce the size of the application to the minimum generate the problem.
  4. Develop a work around for the problem - You did this which will help them

The teams that addresses bugs is usually very busy and focuses on bugs they can figure out quickly.

All that being said, your analyses is probably correct they are probably trimming unreferenced ids and do not know about the ConstraintLayout library and the way constraint_referenced_ids= work.

jafu888 avatar Nov 17 '21 15:11 jafu888

Yes I know but as I said in the issue OP I did not know how to match things with the obfuscated names to be able to create that repro. R8 have a mapping file, there's nothing for the shrinker, had to learn about the arsc file to find things and then be able to do the analysis, when you have hundreds of random names it's hard to check them all to find the correct ones.

I had reported many bugs leading to many fixes, but sometimes I need to know where to look first.

After reporting to lint the same issue a long time ago they did properly take it in account (https://issuetracker.google.com/issues/79995034) so it's just a matter of reaching the proper person.

Tolriq avatar Nov 17 '21 16:11 Tolriq

Thanks for all the effort. It helps improve the tools.

We have similar problems with MotionLayout. In general the teams working on low level tools do not use libraries. We also have no automated ways for libraries to report their dependencies, lint etc.

jafu888 avatar Nov 17 '21 16:11 jafu888