Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target of 'resource-file' in config.xml path correct? #582

Open
3 tasks done
fquirin opened this issue Jul 31, 2022 · 0 comments
Open
3 tasks done

target of 'resource-file' in config.xml path correct? #582

fquirin opened this issue Jul 31, 2022 · 0 comments

Comments

@fquirin
Copy link

fquirin commented Jul 31, 2022

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 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

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant