I read in a Github post "I am using react-native v0.59.9 which uses gradle v5.4.1.". I've used React Native for a while and been able to emulate on Android, but don't recall ever installing Gradle. When I create a React Native app, does it automatically come with Gradle? If so, is there ever a need for me to worry about the Gradle version, or does a given React Native version always come with the corresponding Gradle version?
Asked
Active
Viewed 1,735 times
1 Answers
4
When you install pure react-native app, (i.e not expo) , it comes with 2 directories, one android and the other ios respectively.
So react native uses Gradle for building automation purposes , like generating signed or unsigned APK from the terminal itself.
Similarly in IOS , react native uses cocoapods to download any external native dependencies. And hence , gradle versions is bundled along with the React native app. Feel free to ask any doubts.
Below are the commands to generate signed apk from android directory in React native:
./gradlew assembleRelease -x bundleReleaseJsAndAssets

Gaurav Roy
- 11,175
- 3
- 24
- 45
-
1So to confirm: 1) When you create a React Native project, there is code in and `android/` folder that installs Gradle? 2) If so, does a given version of React Native have a corresponding version of Gradle? If so, would there ever be a reason to change the Gradle version in a React Native project, or would that be a bad idea because all the other code is expecting the existing version? 3) If you already have Gradle installed on your system, and the version is different from the version in your project, would those versions ever conflict? – gkeenley Nov 24 '19 at 22:57
-
1. yes it comes with the gradle version , thats what ive seen. 2.Yes you can change the gradle version , https://stackoverflow.com/questions/51479691/how-can-i-upgrade-react-native-gradle-version 3.Umm, i guess when you sync now with android studio, it will take the gradle version of the project. – Gaurav Roy Nov 25 '19 at 05:17