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.

Buck doesn't package java resources in to the android_library rule.

See original GitHub issue

If you add java resources to an android_library rule like so:

resources = glob([
     'resources/**',
]),
resources_root = 'resources',

They do not get packaged in to the final APK, but if this same android_library rule depends on a prebuilt_jar which contains java resources, they will get packaged in to the final APK.

Here is a sample with a repro of this issue: https://github.com/fbsamples/bucksamples/compare/master...runningcode:no/resources?expand=1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dreisscommented, May 5, 2017

Discussed this with @kageiit and @runningcode . Here’s a summary:

  • Doing this is generally a bad idea because it’s bad for build perf and runtime perf.
  • Gradle does this by default, so we should probably support it.
  • The way to do it is add an option to android_binary to add itself to com.facebook.buck.android.AndroidPackageableCollection#pathsToThirdPartyJars (probably after renaming it).
0reactions
kageiitcommented, Apr 10, 2017

They do get picked up if android_library depends on prebuilt_jars though

Read more comments on GitHub >

github_iconTop Results From Across the Web

android_library() - Buck
An android_library() rule is used to define a set of Java files that can be compiled together against the Android SDK.
Read more >
Buck - building android app with multiple Gradle flavors/build ...
Just to give you the context, I have an application composed of different library modules, each having an Android-Manifest, some resources, ...
Read more >
Rethinking Android app compilation with Buck
The output of a Java rule is a JAR file (Java ARchive, ... Without pipelining, Buck must completely finish compiling the library rule...
Read more >
Use Java 8 language features and APIs - Android Developers
In some cases, your module may not be using the invoke or invokeExact methods even when they're included in a library dependency. So,...
Read more >
build.xml - buck - Git at Google
<property name="aosp.src.dir" value="third-party/java/aosp/src" /> ... However, if the includes parameter is empty, the javac rule will build everything,.
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