Just yesterday I was exporting the game without any problems but when I tried to do it today I got the error mentioned in the title.
Editor settings and export settings are all set with correct paths and keystore user and keystore pass are also set correctly.
Installing build_tools 30.0.3 and uninstalling all other versions.
Installing everything else that is mentioned in the android export docs page with the correct version.
Installing OpenJDK 11 and Open JDK 17 and re-generating the debuy key for both versions.
Reinstalling android studio completely.
I also tried changing the jarsigner path in the editor settings to the apksigner.bat path since some people said that thats what you should do.
None of these worked and I got the same result everytime.