I upgraded to Unity 2022.3.43f1 to target Android SDK 34 and also upgraded Firebase to 12.2.0 and EDMU 1.2.182 and was getting these issues running CI on a mac build machine.
My build script was pointing at /Applications/Unity/Hub/Editor/2022.3.43f1/Unity.app/Contents/MacOS/Unity, but actually because this was an Intel i7 mac, there was another Unity folder added when 2022.3.43f1 was installed (that wasn’t present for other versions): /Applications/Unity/Hub/Editor/2022.3.43f1-x86_64/Unity.app/Contents/MacOS/Unity
Pointing my build script at this folder solved the gradle build issues.