Jenkins with Unity build failed, because of wrong gradle version

I have a Unity project and it uses gradle 6.9.2.
It’s total fine if I build android apk in Unity editor.
It fails when I try to call Unity command line to build android apk from Jenkins.

This is the error log


  • Where:
    Build file ‘C:_Project\Project0012_Jenkins\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\build.gradle’ line: 1

  • What went wrong:
    A problem occurred evaluating project ‘:launcher’.

Failed to apply plugin [id ‘’]
Minimum supported Gradle version is 6.5. Current version is 6.1.1. If using the gradle wrapper, try editing the distributionUrl in C:_Project\Project0012_Jenkins\Library\Bee\Android\Prj\IL2CPP\Gradle\gradle\wrapper\ to


I did what it wrote. I changed distributionUrl to
It didn’t work.
I think somehow when Jenkins runs unity command line to build android apk,
it uses wrong gradle version.
But I don’t know why and how to fix it.
is there anyone know how to fix it?