I get the same error trying to compile sample code from github. It's a new installation of Android studio Iguana 2023.2.1.
compileSdk = 34 minSdk = 24
I tried "Invalidate caches" and restarted Android Studio. As far as I understand HttpRequest has been deprecated for a long time so I don't understand why it's looking for it.
Fixed it by uninstalling Android Studio, deleting appropriate directories under AppData, and reinstalling.