apache / apache/cordova-android
Android: Copy resource files in the correct folder
- Dominant language
- JavaScript
- Stars
- 3.8k
- Forks
- 1.6k
- Avg merge
- 16h 18m
- Merged PRs (30d)
- 11
Description
# Bug Report
I want to copy resources to the `res` directory of the android app.
## Problem
I followed the documentation for the [resource-file](https://cordova.apache.org/docs/en/12.x/config_ref/#resource-file) tag of the `config.xml`, where it shows an example to copy a resource file to `res/values/` for Android:
```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
```xml
```
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
- macOS 15.2
- MacBook Pro 2019 13"
- cordova-cli 12.0.0 (cordova-lib@12.0.2)
## Checklist
- [ ] I searched for existing GitHub issues
- [ ] I updated all Cordova tooling to most recent version
- [ ] I included all the necessary information above
Contributor guide
Research direction
Start with the resource-file entry in config.xml and compare the documented Android target res/values/ with the generated platforms/android/app/src/main/res/values/ location. Reproduce using the provided resource-file example and verify whether the fix belongs in Cordova Android handling or the documentation; done means the file reaches the documented Android resource directory without breaking the iOS behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, javascript
- Domain
- build-system, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100