Help please, "Gradle build failed. See the console for details."

I tried to build test project to know, what i can, before creating real project. But i had a problem with build project for android in aab.

1. Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Program Files\UnityProjects\Clicker Test Game\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\build.gradle’ line: 1

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

Failed to apply plugin ‘com.android.internal.application’.
ANDROID_SDK_HOME is set to the root of your SDK: C:\Users\xxole\AppData\Local\Android\Sdk
ANDROID_SDK_HOME was meant to be the parent path of the preference folder expected by the Android tools.
It is now deprecated.

 To set a custom preference folder location, use ANDROID_USER_HOME.
 
 It should NOT be set to the same directory as the root of your SDK.
 To set a custom SDK location, use ANDROID_HOME.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1s

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Program Files\UnityProjects\Clicker Test Game\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\build.gradle’ line: 1

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

Failed to apply plugin ‘com.android.internal.application’.
ANDROID_SDK_HOME is set to the root of your SDK: C:\Users\xxole\AppData\Local\Android\Sdk
ANDROID_SDK_HOME was meant to be the parent path of the preference folder expected by the Android tools.
It is now deprecated.

 To set a custom preference folder location, use ANDROID_USER_HOME.
 
 It should NOT be set to the same directory as the root of your SDK.
 To set a custom SDK location, use ANDROID_HOME.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1s

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

you need to install the andriod again through unity hub

Excuse me, have you solved this problem? I meet the same one :sob:

this exact problem is why i’ve been using unity 2021 instead. seems like unity doesn’t test their own software as thoroughly as they should

Same issue here, I am interested if someone found a solution