Fix Gradle Could not initialize class AndroidSdkHandler in Android react native application please follow below step to fix the error

Error:-

A problem occurred configuring project ‘:app’.

> Failed to notify project evaluation listener.

   > Could not initialize class com.android.sdklib.repository.AndroidSdkHandler

Fix

Set Java home path to correct location in Mac Os

Step 1. Open a terminal and check Java Version

Step 2. Set Java Home path to correct location

Hit enter and run command to run react native project again

Done