-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Move mavenCentral repo below local paths #32326
Move mavenCentral repo below local paths #32326
Conversation
Base commit: 36f3bf2 |
Base commit: 36f3bf2 |
@cortinico has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Thanks for addressing this.
You're right. I got actually affected by this multiple times. I believe we could:
So Gradle will never fetch RN from |
This pull request was successfully merged by @friederbluemle in 046b026. When will my fix make it into a release? | Upcoming Releases |
Summary: This Diff is restricting the scope of `mavenCentral` to do not include react-native packages. This will make us sure we don't pickup older versions of react-native. This specifically is a problem if you're building on a nightly as the version of RN nightly is `0.0.0.xxx` which is lower than then version on maven central. More on this here #32326 (comment) Changelog: [Internal] [Changed] - Restrict mavenCentral to exclude react-native older packages Reviewed By: ShikaSD Differential Revision: D31571803 fbshipit-source-id: d7ce7e82825cbebda2e4e534565d7ab15dba2624
Summary
In #31609, the deprecated
jcenter()
was replaced withmavenCentral()
. In the template build.gradle, it also changed the order of repos. I am not sure if this was done intentionally or not (@dulmandakh please confirm). Instead of appearing right aftergoogle()
,mavenCentral()
was put first in the list, even before the local repos (that, for example, contain thereact-native
artifacts fetched by npm). Now, under normal circumstance, this might not cause issues because of latency, but there is chance that Gradle could resolve incorrect versions (or at least look in the wrong repo first). The last version ofreact-native
published to the public repo was0.20.1
, uploaded in February 2016!This PR changes the order of
mavenCentral()
so that is consistent with both the repo's current root level build.gradle, as well as other default Android templates. Putting the local repos first will ensure they have the highest priority when looking for artifacts.react-native
should always come from the locally downloadednode_modules/
folder, not from a remote repo.Changelog
[Android] [Changed] - Move mavenCentral repo below local paths
Test Plan
Create new app from template, ensure local repos appear before remote repos;
react-native
resolves to correct version.