-
Notifications
You must be signed in to change notification settings - Fork 24.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
compile 'com.facebook.react:react-native:+' defaults to 0.20.1 #12309
Comments
So apparently there is a HUGE difference between putting the maven def inside the buildscript{} vs allProjects{} block. Would be nice if the integration doc reiterated this as being especially important. |
Which part in the integration doc are you talking about exactly? Or, better, would you be interested in sending a pull request to improve it? |
https://facebook.github.io/react-native/docs/integration-with-existing-apps.html From above... In your project's build.gradle file add an entry for the local React Native maven directory:
Make sure that the path is correct! You shouldn’t run into any “Failed to resolve: com.facebook.react:react-native:0.x.x" errors after running Gradle sync in Android Studio. I think adding something that says... Note: be sure to add this maven url to the allProjects block of your build.gradle. The code example does show it inside the allProjects block but It's a very small detail that can be easily missed. Since this doc is talking about integrating react native with existing apps, it's possible that the build.gradle your'e putting this code in is huge (like the one I was just working with) and have multiple blocks with maven defs in different places. Just a nit that I think will help people not waste time trying to integrate RN into their apps. There are many other hurdles one must solve and adding a simple note could make a world of difference. I would love to make a PR for this but I don't think those docs are in this repo? |
Ah I am super excited that you would love to make a PR for this ;-) Those docs are indeed in this repo, check out https://github.com/facebook/react-native/blob/master/docs/IntegrationWithExistingApps.md . If you @ me in your PR then I will look at it real quick! |
I hit this problem too, but I'm not sure what the solution is? I've got
|
I got this fixed by changing to reference a specific react-native version:
Then I'd get an error when compiling, unable to find it. Then changed to:
From
|
I also got it working with @alexblack's change. But I also had accidentally typed single rather than double quotes, which was preventing the expansion of |
@alexblack Yes, thank you for this! It's important to make sure your path is correct. I copied from the React Native docs thinking it would just work but I had to make the same change as you since I don't have an Thanks for the pointer. |
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally! If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution. |
Description
Following the integration steps outlined here...
https://facebook.github.io/react-native/docs/integration-with-existing-apps.html
The version of React Native that I get as an External Library is 0.20.1 (Seeing this in android studio)
My package.json says the version is 0.41.2
Please help me get the right version... I don't have access to new classes that were added between 0.20.1 and 0.41.2
I thought maybe the .gradle/cache was the issue here but it is not
The last released version in Maven Repo is 0.20.1
For some reason this definition in my projects build.gradle is not finding the jar. I have double - triple checked this path and its correct...
So this
compile "com.facebook.react:react-native:+" // From node_modules.
is defaulting to the Maven Repo 0.20.1 instead of my local node_modules installed jars. I have verified that that the local version i have in node_modules is 0.41.2
What am i missing here...?
Reproduction
Follow the integration instructions for react native in the docs
Solution
Make sure the maven url definition in the project build.gradle is inside the allProjects{} block
Additional Information
The text was updated successfully, but these errors were encountered: