feature modules vs. AndroidManifest MidiDeviceService meta-data resource

21 views
Skip to first unread message

LD

unread,
Feb 26, 2022, 11:08:11 PM2/26/22
to android-midi
Say I have my midi implementation in a dynamic feature module and want to keep its setup well contained in that module, while one can specify the MidiDeviceService in the feature module's AndroidManifest (which gets merged via manifest merging to the main app one), any reference to an xml resource containing the meta-data devices list fails. I've found that I must provide that in the top-level app module, so its like the feature module's AndroidManifest has to reference the top-level module's resources only for this meta-data information = unfortunate.

And since we are unable to simply include the metadata recourse contents within the meta-data tag (else "AAPT: error: unexpected element <devices> found in <manifest><application><service><meta-data>."), it seems this resource linking does not support feature modules.

Any ideas as to how I could achieve my goal?

LD

unread,
Mar 3, 2022, 6:55:25 AM3/3/22
to android-midi
I found that only a stub of devices is needed, the rest can exist in another module. E.g. in app/res/xml/midi_service_device_info.xml

<?xml version="1.0" encoding="utf-8"?>
<devices /> <!-- STUB OR ANDROID SPITS THE DUMMY -->
Reply all
Reply to author
Forward
0 new messages