Hello. I had the same error.In my case The problem was in the signing section. I fix it by apply the signing manually:
add the plugin in your gradle:
id("signing")
then config it:
signing {
useInMemoryPgpKeys(
keystoreProperties["signing.keyId"].toString(),
File(keystoreProperties["signing.secretKeyFile"].toString()).readText(),
keystoreProperties["signing.password"].toString()
)
}
hope it helps someone. Happy coding