capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

[Bug]: xml resources not merged into AndroidManifest

Open soundwave12345 opened this issue 1 year ago • 4 comments

Capacitor Version

capacitor 7.0.2

Other API Details


Platforms Affected

  • [ ] iOS
  • [x] Android
  • [ ] Web

Current Behavior

I'm crafting a plugin to use android auto with my app. To be able to use my app on AA it needed to have this in androidmanifest.xml:

               <meta-data 
            android:name="com.google.android.gms.car.application"
            android:resource="@xml/automotive_app_desc" />

then the linked file in /android/src/main/res/xml/automotive_app_desc.xml

<?xml version="1.0" encoding="utf-8"?>
<automotiveApp>
    <uses name="media"/>
</automotiveApp>

After the merge in androidmanifest i have:

               <meta-data 
            android:name="com.google.android.gms.car.application"
            android:resource="automotive_app_desc" />

and no automotive_app_desc.xml in any location of the project.

To be able to build for android auto I have to manually add after npx cap sync the file in: /android/src/main/automotive_app_desc.xml

It would be nice to have it auto merged.

Expected Behavior

Merged automatically. in AndroidManifest.xml and related files

Project Reproduction

https://github.com/soundwave12345/capacitor-android-auto/

Additional Information

No response

soundwave12345 avatar Dec 04 '25 14:12 soundwave12345

@soundwave12345 I am working on this! Will raise a PR soon!

Suryansh0910 avatar Dec 04 '25 17:12 Suryansh0910

@soundwave12345 Hey, I believe I’ve fixed the issue. Could you review it when you get a chance? I’ve already opened a PR.

White-D-coder avatar Dec 05 '25 08:12 White-D-coder

@White-D-coder just tried with this package.json:

  "dependencies": {
    "@capacitor-plus/android": "8.0.0-beta.0",
    "@capacitor-plus/core": "8.0.0-beta.0",
    "lucide-react": "^0.344.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@capacitor-plus/cli": "8.0.0-beta.0",

in the main app, not in the plugin. xml still not existent.

soundwave12345 avatar Dec 05 '25 10:12 soundwave12345

@White-D-coder sorry tough this PR was already merged.

soundwave12345 avatar Dec 05 '25 10:12 soundwave12345