Fixed
Status Update
Comments
xa...@android.com <xa...@android.com> #2
Yes, the issue is that we generate a single folder with all the resources resolved (with flavors overriding values coming from defaultConfig) and then that folder is added to the ResourceSet setup for the main/defaultConfig.
This would require us to instead not merge the res values coming from build type/default config/flavors and instead create a new res folder for each and let the resource merger merge them with the regular resources.
This would require us to instead not merge the res values coming from build type/default config/flavors and instead create a new res folder for each and let the resource merger merge them with the regular resources.
[Deleted User] <[Deleted User]> #3
If override was possible it would help a lot
je...@google.com <je...@google.com>
hu...@gmail.com <hu...@gmail.com> #4
same issue in android studio 2.2.3, :(
cu...@gmail.com <cu...@gmail.com> #5
same issue in 2.3.1
ch...@google.com <ch...@google.com>
jo...@google.com <jo...@google.com>
xa...@google.com <xa...@google.com>
hu...@google.com <hu...@google.com> #6
[Build-and-Sync Fix-It Week] Requesting TL re-triaging as this issue has a lot of votes and is not yet fixed in AGP 8.0.0-alpha01.
je...@google.com <je...@google.com>
hm...@google.com <hm...@google.com> #7
This has been fixed and should be released in AGP version 8.0.0-alpha05
Description
Android gradle plugin version: 0.13.1
OS: MacOS
STEPS TO REPRODUCE:
1. Add a string to res/values/strings.xml
e.g. <string name="app_name">SimpleTest</string>
2. Add a product flavor which overrides this string:
productFlavors {
INT {
resValue "string", "app_name", "SimpleTest INT"
}
}
3. Execute:
gradle assembleINTDebug
EXPECTED RESULTS:
Build succeeds and the app is named "SimpleTest INT"
OBSERVED RESULTS:
Build fails with error:
:SimpleTest:mergeINTDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':SimpleTest:mergeINTDebugResources'.
> /Users/xyz/AndroidStudioProjects/SimpleTest/SimpleTest/build/generated/res/generated/INT/debug/values/generated.xml: Error: Duplicate resources: /Users/xyz/AndroidStudioProjects/SimpleTest/SimpleTest/build/generated/res/generated/INT/debug/values/generated.xml:string/app_name, /Users/xyz/AndroidStudioProjects/SimpleTest/SimpleTest/src/main/res/values/strings.xml:string/app_name
ADDITIONAL INFORMATION:
When I add a resource file via a sourceSet for this build flavor instead of using resValue, I can successfully override the app_name.
I think setting a resource with resValue should behave the same as when using a sourceSet.