Skip to content

Android: Copy resource files in the correct folder #1753

@GitToTheHub

Description

@GitToTheHub

Bug Report

I want to copy resources to the res directory of the android app.

Problem

I followed the documentation for the resource-file tag of the config.xml, where it shows an example to copy a resource file to res/values/ for Android:

<resource-file src="FooPluginStrings.xml" target="res/values/FooPluginStrings.xml" />

When I use this code, the resource file gets copied to platforms/android/res/values, but the correct folder would be platforms/android/app/src/main/res/values.

When I do the same for iOS with

<platform name="ios">
    <resource-file src="FooPluginStrings.xml" target="FooPluginStrings.xml" />
</platform>

It gets correctly copied to platforms/iOS/[AppName]/Resources (using cordova-ios 7.1.1).

Should there be not a similar behavior for Android? Must the documentation be updated to the correct path, or is this an issue in the Cordova-cli?

What is expected to happen?

The resource file should be put in the correct folder like the documentation says.

What does actually happen?

The resource file is copied in the wrong place.

Information

Command or Code

Environment, Platform, Device

Version information

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions