Android res/raw resources from libraries are not included in the final APK
See original GitHub issueWe’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:
- Created 7 years ago
- Comments:6 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 thoseR.raw
fields and that worked fine.Just tried it with current master of Buck, issue still exists