Android Question Persistent Resource Linker Error (aapt) for Voice Interaction XML in B4A (v13.40)

kent

Member
Licensed User
Longtime User
Hi all,
I'm developing a Headless Voice Interaction Service (Custom Digital Assistant) for Android TV using B4A v13.40.
B4A code compiles *only* when the reference to the necessary XML resource is removed.

When I include the reference, I consistently hit a Linker Error, which suggests the compiler (aapt) cannot find the physical file, despite correct placement.

**The Error (Persists after all troubleshooting):**
---
Linking resources Error AndroidManifest.xml:XX: error: resource xml/voice_interaction_service (aka [package name]:xml/voice_interaction_service) not found. error: failed processing manifest.
---

**My Setup & Attempts (Confirmed Clean):**
* **B4A Version:** 13.40 (using AndroidX SDK).
* **Target File:** `voice_interaction_service.xml`.
* **Manifest Reference:** I'm using the most stable, raw Manifest injection to define the metadata:
```b4a
AddManifestText(
<application>
<meta-data android:name="android.voice_interaction" android:resource="@xml/voice_interaction_service" />
</application>
)
```
* **File Placement (Tried and Failed):** The file is physically located on disk in the necessary Android resource path:
* `[ProjectFolder]\Files\res\xml\voice_interaction_service.xml`
* **Inclusion:** The file is added and visible in the B4A File Manager.
* **Workarounds Attempted:** I have tried using `@raw/` instead of `@xml/`, and tried creating a Macrolibrary (`.baml`) to force inclusion, but the linker always fails to find the resource during the final build step.

It seems B4A's internal resource linker is unable to map files from the `Files\res\xml` path into the APK structure for this specific file type/reference.

Has anyone encountered this persistent *linker failure* (not syntax error) in recent B4A versions and found a specific configuration fix or a definitive workaround?

Thanks for any help!
(Ps: Chatgpt is partially used for the above.)
 

zed

Well-Known Member
Licensed User
Have you tried
B4A:
#AdditionalRes: ..\res\xml

Create a folder named res\xml next to your project.
Place voice_interaction_service.xml inside it.
Add the #AdditionalRes directive so that B4A includes this folder as an Android resource.
Then, @xml/voice_interaction_service will be recognized.
 
Upvote 0
Top