How solve (Could not initialize class org.codehaus.groovy.reflection.ReflectionCache) issue in react native

I think I had the same issue. After installing RN (May 20th, 2020), I bumped into this error. I found this solution on

In short:

  1. Go to /android/gradle/wrapper/ file in your RN project

  2. Find this line that starts with distributionUrl. Change the gradle version into

In my project, it was:


and I changed it into:


That's it.

I had the same error on Mac OS and React Native v0.62.

Apply these instructions correctly: React native environment setup

Adding this variable solved my problem:

export JAVA_HOME="/Applications/Android"

In the React Native version 0.62.x even the initialized application is not ready for a development build.

I change the Gradle version to the latest and I could to have a clean build, so change this file:

// this file => /android/gradle/wrapper/





Pay Attention: The latest version of the Gradle for my time is 6.5. when you are reading this answer please check this link to see the latest version number of the Gradle.