You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/07/31 07:24:39 UTC

[GitHub] [cordova-cli] fquirin opened a new issue, #582: target of 'resource-file' in config.xml path correct?

fquirin opened a new issue, #582:
URL: https://github.com/apache/cordova-cli/issues/582

   # Bug Report (or feature?)
   
   ## Problem
   
   When using `target` in `<resource-file>` tag of `config.xml` the path location is unclear looking at the documentation.
   
   ### What is expected to happen?
   
   When using `<resource-file src="FooPluginStrings.xml" target="res/values/FooPluginStrings.xml" />` as [described in the docs](https://cordova.apache.org/docs/en/11.x/config_ref/index.html#resource-file) I'd expect the file to end up in the according resources folder of the platform, in this case `app/src/main/res/values/FooPluginStrings.xml`.
   
   ### What does actually happen?
   
   The file ends up in the top-level project folder for Android.
   
   ## Information
   
   I'm not sure if this is a bug or a feature but the documentation is at least misleading. `res/values/...xml` is the classic resource path for Android platform but you have to use `app/src/main/res/values/...xml` as `target` to actually get this path. In the example this should be:
   ```
   <resource-file src="FooPluginStrings.xml" target="app/src/main/res/values/FooPluginStrings.xml" />
   ```
   
   In addition it seems the behavior in `config.xml` and `plugin.xml` is different 🤔. Plugin resource files seems to be placed in the correct folder without adding `app/src/main`.
   
   ### Command or Code
   
   Put a resource in your config.xml and build the Cordova project, as seen in the docs:
   ```
   <resource-file src="FooPluginStrings.xml" target="res/values/FooPluginStrings.xml" />
   ```
   
   ### Environment, Platform, Device
   
   Debian 9.5 terminal (Windows 11 WSL2), x86_64
   
   ### Version information
   
   Cordova: 11.0.0, Android platform 11.0.0
   Other Frameworks: none
   Operating System: Debian 9.5 on Windows 11 WSL2
   
   ## Checklist
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org