I also faced the same problem today. My friend works on my startup with the latest version of AndroidStudio and i installed that IDE a month ago
So i just simply found the libs.versions.toml file and updated this line:
[versions]
agp = "8.9.1"
previous was 8.11.1