I haven't seen a gradle error before. from what I'm seeing, it could be an SDK setup error, did you follow any specific tutorials for setting up android SDK with UE?
I think I had android setup for UE 5.1, but I may have reset windows since I last packaged so I don't know if I still have the SDK setup but when I get a chance I'll check