Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
When this error message is returned, look at the log. There are sure to be other problems which you should fix.
You’re probably running to problems with Android 12, which is now the default for builds. We’ve been talking about this for a few months.
Have a look at this article. It will help you update your app for Android 12. If you are not ready to update yet, it also tells you how to continue building using the old version.