Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Gradle build failed. See the Console for details. No clear idea why.

Discussion in 'Android' started by KIV327, Nov 13, 2023.

  1. KIV327

    KIV327

    Joined:
    Nov 11, 2023
    Posts:
    6
    Last edited: Nov 13, 2023
  2. FlameRax

    FlameRax

    Joined:
    Apr 23, 2020
    Posts:
    2
    Same problem here ;(
     
  3. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,924
    Click on "CommandInvocationFailure" entry in the console and share the complete log details.
     
  4. KIV327

    KIV327

    Joined:
    Nov 11, 2023
    Posts:
    6
  5. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,924
  6. KIV327

    KIV327

    Joined:
    Nov 11, 2023
    Posts:
    6
  7. IGuscin

    IGuscin

    Unity Technologies

    Joined:
    May 12, 2022
    Posts:
    48
    You're missing SDK 33. Either install it using SDK Manager or set Target SDK to 33 as workaround - Unity should suggest you installing missing API
     
  8. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,924
    You can try the following
    1. Try running unity with "Run as Administrator" option Or
    2. Accept licenses with below command
    Code (CSharp):
    1.  
    2. //For Windows
    3. PATH-TO-UNITY-ANDROID-SDK\tools\bin\sdkmanager --licenses
    4.  
    5. //For Mac
    6. /Applications/Unity/Hub/Editor/UNITY_VERSION/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager --licenses
    Or
    3. Let me know if the above two options still didn't work. There is one another option to try which needs some explanation about the process.
     
  9. KIV327

    KIV327

    Joined:
    Nov 11, 2023
    Posts:
    6
    did not help
     
  10. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,924
    Ok, delete these two highlighted folders and copy from Android Studio Android SDK folders.
     

    Attached Files:

  11. KIV327

    KIV327

    Joined:
    Nov 11, 2023
    Posts:
    6
    upload_2023-11-14_18-10-54.png
     
  12. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,924
    Not sure what you mean. It would be great if you can add some context to be on same page.
    If you have 32.0.0 build-tools, delete that and copy from your default android sdk.
     
  13. geunueom

    geunueom

    Joined:
    Nov 14, 2023
    Posts:
    3
    Try the next solution.
    For a new SDK, install 'Android Studio' as default, and run 'Android Studio' one time, then SDK is installed autumatically.
    And find 'cmdline-tools' folder in Unity folder. Usually it is located like 'C:\Program Files\Unity\Hub\Editor\2022.3.3f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK'

    Copy 'cmdline-tools' folder and paste in the new sdk folder, usually is located like
    'C:\Users\[your name]\AppData\Local\Android\Sdk'

    As next, in Unity, Edit => Preferences => External Tools, and uncheck for SDK locate recommand option, and click Browse button, and allocate the new SDK place like 'C:\Users\[your name]\AppData\Local\Android\Sdk'

    And try to build again!
     
  14. KIV327

    KIV327

    Joined:
    Nov 11, 2023
    Posts:
    6
    thanks for the help. The solution to this problem is to reinstall unity (not the unit hub) and unity itself will prompt you to download the required version of the SDK when you build