Hi, I finally solved the problem with android studio. I will list the steps if it can help someone.
1) I deleted the .idea folder
2) I deleted the .gradle folder
3) I closed Android Studio
4) I restarted Android Studio
5) I waited for the missing parts to install again
Finally he was giving me no more mistakes.
6) I started the emulator and it was giving me a version buil error.
7) I closed Android Studio again
8) in the / android / sdk folder I deleted the build folder that gave me error (31.0.0-rc5).
9) I started Android Studio again
Finally the emulator was working too
I generated the build bundle and uploaded to Play Console internal App Sharing and tested it for a few days, until now without any problems.
Hope it helps