To generate the SHA-1 using Gradle in Android Studio:
Open the Gradle panel on the right-hand side of Android Studio.
Select Execute Gradle Task.
Type signingReport and press Enter.
This will run the signingReport task, and you’ll see the SHA-1 and SHA-256 keys in the Run window at the bottom.