Internal error: SHA-1 not available

Hi, I have a problem while trying to compile an ionic project freshly created on an android platform. here’s the error:

FAILURE: Build failed with an exception.

* What went wrong:
internal error: SHA-1 not available.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at
/opt/gradle/gradle-6.4/bin/gradle: Command failed with exit code 1
[ERROR] An error occurred while running subprocess cordova.
        cordova build android --device exited with exit code 1.

FYI: I tried installing android sdk and gradle manually then I tried installing them with android studio but ntg changes, I’m new to the forum so I don’t know if I should give more informations, if so please ask me to.

Thank you in advance