Open5

CommandInvokationFailure: Gradle build failed.というエラー

イワケンイワケン

エラー文

Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

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

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

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\workplace\Unity\MRTemplate\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\owner\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 28s

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
CommandInvokationFailure: Gradle build failed. 
D:\Program Files\Unity\Hub\Editor\2022.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "D:\Program Files\Unity\Hub\Editor\2022.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Build completed with a result of 'Failed' in 483 seconds (482887 ms)
3 errors
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
イワケンイワケン

試したこと①【途中で挫折】

Android Studioのバージョン

  • File > Settings
    • Appearance & Behaviour
      • System Settings
        • Android sdk

  • Android SDK Platform 29をインストール

Unity開く

  • Edit > Preferences > External Tools
    • Android SDK ToolsのパスをAndroid Studioで設定されたパスに設定

ビルドできず (違うエラーが)