-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Android: Copy resource files in the correct folder #1753
Comments
There's some history here that's worth knowing. The Android platform moved from being an Eclipse (ant) project to being an Android Studio (gradle) project, and the project structure changed. Previously, To avoid breaking all the existing plugins, there's a remapping system in cordova-android that will take "old" paths and rewrite them to the newer paths. That remapping appears to be used unconditionally The workaround is to specify the full path that you want for the file, i.e. It's not feasible to automatically prefix all resource files with |
I understand. On my opinion checking for |
Android has a concept of build variants so i don't think it's a good idea to auto prefix and assume app/src/main.
So I think we should consider this a doc issue. |
Thank you @breautek, I didn't know about this. Could this path nevertheless automatically calculated for build variants? Is it really needed do decide in which build variant a resource file will be copied? Does |
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 tores/values/
for Android:When I use this code, the resource file gets copied to
platforms/android/res/values
, but the correct folder would beplatforms/android/app/src/main/res/values
.When I do the same for iOS with
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
The text was updated successfully, but these errors were encountered: