Cannot build using unity for Android

Hello, I’m having massive problems with Gradle in Unity and I have no idea what the errors mean as I am new at this. Could someone tell me what to do? I upgraded Gradle, but that made things worse.

> Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

I know this one means I have to go back a few versions, but which one do I go to?

> Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 FAILURE: Build failed with an exception. What went wrong: 
>Could not determine the dependencies of task ':launcher:lintVitalReportRelease'.
> Could not create task ':launcher:processReleaseMainManifest'.
> Cannot use @TaskAction annotation on method IncrementalTask.taskAction$gradle_core() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.

I really don’t know what this means.

The first is just a warning, so does not necessarily mean that you need to downgrade Gradle just that you cannot upgrade to Gradle 9.

The second on the other hand means exactly that.
You are using a class that was removed in Gradle 8.0 (org.gradle.api.tasks.incremental.IncrementalTaskInputs).

Assuming you are not writing your Gradle build yourself, this is not really the right forum for you, but instead you should ask whoever is generating the build.

But obviously whatever generates the build is not compatible with Gradle 8+.
So downgrading Gradle to 7.6.4 at max might resolve the problems you have eventually.

To be honest, I’m just using Unity to build an Android game. I only heard about Gradle last week when I started beta testing. Nobody I talk to seems to know anything about this system, so it would be hugely helpful if you could talk me through fixing this.

Again, I have no idea about Unity.
If you do not write the build yourself but Unity generates it for you, you are wrong here.
Instead, you need to seek help from a Unity community or Unity support or documentation or whatever.