How can I upgrade react-native gradle version

Siberhecy picture Siberhecy · Jul 23, 2018 · Viewed 37.7k times · Source

I need help. I can't upgrade gradle version of my react-native project.

I try a lot of things, downloaded last version of Android Studio & SDK Tools etc.

I changed this file \android\gradle\wrapper\gradle-wrapper.properties, I tried to upgrade using npm install -g react-native-git-upgrade but still I can't upgrade it.

When I react-native eject It's exports "distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip"

Waiting for answers.

Answer

Daniel Gabor picture Daniel Gabor · Jul 23, 2018

In android/build.gradle you have to edit this line

classpath 'com.android.tools.build:gradle:x.y.z'

Change x.y.z with the version you want. Edit it with Android Studio then click Sync now