Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Bug Unity 2022.3.23f1 Android Build for VR running into Gradle build fail!

Discussion in 'Editor & General Support' started by Proxdleon, Apr 16, 2024.

  1. Proxdleon

    Proxdleon

    Joined:
    Oct 8, 2019
    Posts:
    2
    I am trying to run a VR Projekt for an Android Build on Unity Version 2022.3.23f1. I also installed the JDK and SDK tools for Android. As soon as I try to process the build as a normal User I ran into several Errors.:
    "Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details"
    "Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8"
    "CommandInvokationFailure: Gradle build failed.
    C:\Program Files\Unity\Hub\Editor\2022.3.23f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.3.23f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease""
    I added the error logs from the console.

    If I start Unity via admin privileges the build will run without any problems, but Unity is not supposed to run as an admin.
    Is this problem known and is there a solution?
    The problem is urgent, because my learning/programming class is starting soon and the students are working with Unity all the time.
     

    Attached Files:

  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,251
    Please add the logs as txt or just paste it. Not going to download random 7z files
     
    CodeSmile likes this.
  3. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    7,263
    Very likely that the problem is due to file/folder or other permissions. You may have installed the JDK with admin rights where you shouldn't have, or either of these (JDK, editor, project, anything else related) is in a folder where a standard user account has no write and/or execute permissions. Or the user you're logged in with has limited permissions to begin with.

    A complete uninstall of editors, hub and jdk and reinstall may help, ideally to default locations. If not then doing so in a new user account might be an alternative.
     
  4. Proxdleon

    Proxdleon

    Joined:
    Oct 8, 2019
    Posts:
    2
    Sry, here are the .txt for the logs.

    @CodeSmile
    Only the Admin is able to install Unity and the SDK/JDK Add-Ons.
    The same errors accure under Unity 2022.3.24f1
    I installed Unity in default location and Users also got permissions.
    Maybe you see something in the logs I dont see.
     

    Attached Files:

  5. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    7,263
    Is the user an "Administrator" account?

    Launching the installers etc without "run as administrator" should pop up the corresponding UAC control or login dialog when the executable requests it. That's the procedure you should follow. If this fails without either of these options, the account is incorrectly set up or too restricted (eg by policy).


    Check if you have this Universal C Runtime installed.
    Otherwise not being able to launch a Daemon (service) could also indicate a system/account that has insufficient rights to perform launching a service.