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.

Android res/raw resources from libraries are not included in the final APK

See original GitHub issue

We’re seeing this issue while trying to integrate Buck into our project. We first noticed this due to a crash on the jodatime-android library, which uses reflection to load resources from R.raw. Turns out that the raw class for library dependencies (aar) is completely empty when building with buck. The same class is correctly populated when building with gradle. Is this a known issue/limitation?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
felipecslcommented, Sep 22, 2016

So it turns out this was caused by jodatime-android accessing its R.raw resources via reflection. Apparently Buck is trimming them since they are not directly referenced anywhere in the code. Our workaround was to create a simple class that keeps references to all those R.raw fields and that worked fine.

0reactions
felipecslcommented, Sep 21, 2016

Just tried it with current master of Buck, issue still exists

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resources are missing in apk - Stack Overflow
I'm trying to add a .wav file to my React Native app and having a problem with Android implementation ...
Read more >
App resources overview - Android Developers
Resources are the additional files and static content that your code uses, such as bitmaps, layout definitions, user interface strings, ...
Read more >
SmallerAPK, Part 3: Removing unused resources - Medium
There's two ways you can remove resources that are not used by your app, but get packaged into the APK because they're in...
Read more >
build/config/android/rules.gni - chromium/src - Git at Google
If this target is included in the deps of an android resources/library/apk,. # the resources will be included with that target.
Read more >
Inspecting APK Files - PSPDFKit
An APK file contains app code in the DEX file format, native libraries, resources, ... These include both Android dependencies shipped as AAR...
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