I have been trying to solve this issue for some days now and have tried reinstalling android studio, and visual studio code too, but the error persist, i have also followed instructions on the android site too.
I have updated the gradle wrapper properties file to 8.6,
this is what my build.gradle(android) file looks like: