question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Don't run resource union in MiniAapt" #2086 appears to break resource merging

See original GitHub issue

https://github.com/facebook/buck/pull/2086 appears to have broken our app’s resource merging.

Specific breakage I noticed (the earliest breakage): we have an ids.xml with a placeholder id in a package com.my.package

The generated class appears to be found in buck-out/bin/common/my/other/package/lib__src_debug#dummy_r_dot_java__scratch/classes/com/my/package/containerconstants/R$id.class class file, but compiling the app fails with error: cannot find symbol when referenced from another package.

After reverting this change, our app compiles normally with Buck again.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
alexjlockwoodcommented, Mar 6, 2019

@raviagarwal7 @kageiit I have a branch that reproduces the error we are seeing: https://github.com/uber/okbuck/pull/826

0reactions
raviagarwal7commented, Mar 8, 2019

@raviagarwal7 @kageiit I have a branch that reproduces the error we are seeing: uber/okbuck#826

@artem-zinnatullin, does this shows the behaviour that broke with the pr #2086?

If resource union is needed doing union in MergeAndroidResourcesStep is the right way to go which handles styleable correctly. I think the resource_union flag can be removed from android_resource (missed removing it in that pr) and needs to be added to android_binary and robolectric_test.

setting resourceUnion would enable resource union with the original package otherwise uses the specified package. setting resourceUnionPackage uses this as the union package.

Seems like gradle has the same default behaviour and I think this change in BUCK will make it work similarly.

So, this requires 2 changes:

  • change buck to handle original package name resource union correctly and remove the flag from android_resource.
  • change okbuck to remove outputting resource_union from android_resource and output correctly according to the above change.

From OkBuck docs.

  /**
   * Set to use buck's resource_union behavior with the original package name or the defined by
   * {@link OkBuckExtension#resourceUnionPackage}
   */
  @Input public boolean resourceUnion;

  /** Set to use buck's resource_union behavior with an specific package name */
  @Nullable @Input public String resourceUnionPackage;

feel free to create PR’s and cc me on it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Don't run resource union in MiniAapt" #2086 appears to break ...
"Don't run resource union in MiniAapt" #2086 appears to break resource merging. ... appears to have broken our app's resource merging.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found