-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Fix duplicate resource error in Android gradle build (#22234) #24778
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
This PR could close #24759 |
This pull request was successfully merged by @Dbroqua in eb534bc. When will my fix make it into a release? | Upcoming Releases |
You're welcome! |
Awesome! Works with latest build tools 🚀 |
Summary: Pull requests #24518 #24778 make Gradle copy all **generated** assets and resources into `android/app/src/res`, which is a bad behavior, because `src/res` goes into version control and should hold only those **original** resource files. These changes in #24518 #24778 were merged into 0.60.0-rc release and cause regression. This pull request will: - Revert pull requests #24518 #24778 - Close #25325 ## Changelog [Android] [Fixed] - Fix regression of improper assets copy (revert #24518 #24778) Pull Request resolved: #25363 Test Plan: It is a revert pull request and the reverted script should work the same as it has in 0.59.x. Differential Revision: D15963329 Pulled By: cpojer fbshipit-source-id: 5619a318dbdb40e816e37b6e37d4fe32caa46e9e
Summary: Pull requests #24518 #24778 make Gradle copy all **generated** assets and resources into `android/app/src/res`, which is a bad behavior, because `src/res` goes into version control and should hold only those **original** resource files. These changes in #24518 #24778 were merged into 0.60.0-rc release and cause regression. This pull request will: - Revert pull requests #24518 #24778 - Close #25325 ## Changelog [Android] [Fixed] - Fix regression of improper assets copy (revert #24518 #24778) Pull Request resolved: #25363 Test Plan: It is a revert pull request and the reverted script should work the same as it has in 0.59.x. Differential Revision: D15963329 Pulled By: cpojer fbshipit-source-id: 5619a318dbdb40e816e37b6e37d4fe32caa46e9e
…k#24778) (facebook#25363) Summary: Pull requests facebook#24518 facebook#24778 make Gradle copy all **generated** assets and resources into `android/app/src/res`, which is a bad behavior, because `src/res` goes into version control and should hold only those **original** resource files. These changes in facebook#24518 facebook#24778 were merged into 0.60.0-rc release and cause regression. This pull request will: - Revert pull requests facebook#24518 facebook#24778 - Close facebook#25325 ## Changelog [Android] [Fixed] - Fix regression of improper assets copy (revert facebook#24518 facebook#24778) Pull Request resolved: facebook#25363 Test Plan: It is a revert pull request and the reverted script should work the same as it has in 0.59.x. Differential Revision: D15963329 Pulled By: cpojer fbshipit-source-id: 5619a318dbdb40e816e37b6e37d4fe32caa46e9e
Summary:
If
$buildDir/generated/res/react/${flavorPathSegment}release/raw
contains files duringgradle assembleRelease
script will fail withError: Duplicate resources
error.This patch is based on this issue 22234 and pull request 24518.
Changelog
[Android] [Fixed] - Fix duplicate resource error for raw folder in Android build
Test plan
[CC from Mike Hardy PR]
Reports of success on the linked issue via use of the patch + patch-package for a couple months, I personally use it full time with all gradle builds (./gradlew clean assembleRelease or if you have a 'staging' flavor, e.g. ./gradlew clean assembleStagingRelease)
Related reading, also cross-links with the linked issue here:
https://stackoverflow.com/questions/53239705/react-native-error-duplicate-resources-android