If you dont want upgrade you android studio, you can follow this step
Open your project's build.gradle file. You'll see something like this:
plugins{ alias(libs.plugins.android.application) }
Click on application -> right click -> go to declaration
you will go to lib.versions.toml file
find agp and change it to 8.2.1