Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Automatic Unity Version Detection, Supported?

Discussion in 'Unity Build Automation' started by itsmikeu, Aug 10, 2023.

  1. itsmikeu

    itsmikeu

    Joined:
    Jan 12, 2022
    Posts:
    10
    Description of issue:
    Is it possible for Unity Build Automation to automatically select the Unity version based on the project's
    ProjectSettings/ProjectVersion.txt
    file? I was told in the Discord server that this should be a supported feature if the project is using Unity Version Control, but the option does not appear to be there:
    Screenshot 2023-08-10 at 1.01.49 PM.png

    Our Unity Version Control Organization is encrypted; could that be preventing this feature from working? Or does this feature just not exist?

    Unity version: 2021.3.28f1

    XCode version: N/A

    Source control: Unity Version Control, Encrypted Organization

    Local build platform: N/A

    Build target: Windows

    Relevant plugins being used (i.e. Google Play Game Services, other plugins that may perform automatic post-build behaviors): N/A

    Project name: N/A

    Build log (relevant chunk): N/A

    Does it build locally from a fresh checkout? (Instructions below): N/A
     
  2. Benjamin-Gooding

    Benjamin-Gooding

    Unity Technologies

    Joined:
    Apr 12, 2022
    Posts:
    240
    Yes, it should be supported as far as I know. I know for a fact we have the code to read the contents of that file for UVCS. What I would suggest is checking out the API docs and making a call to update the build target. There should be a setting in there for auto detect Unity version. I'd set that to true and then remove the preferred unity version value. Then kick off a build, it should auto detect for you. If it complains and won't start the build then there is something blocking this in our back end code.

    I'll touch base with our web team in the morning to look at getting that updated and also see about getting someone on the team to run some tests to validate it.
     
  3. itsmikeu

    itsmikeu

    Joined:
    Jan 12, 2022
    Posts:
    10
    Hello, thank you for the response. I believe we actually discussed this in Discord a few months back, with the end result being I needed to send in a support ticket. I never sent in a support ticket, and I was hoping the issue had resolved itself since then.

    Unfortunately it looks like it is still broken. I set
    settings.autoDetectUnityVersion
    to
    true
    , but building now fails:

    (I censored parts of the error message, since I am not sure if any of it is sensitive)

    This error happens whether I use clean build or normal.

    I can submit a support ticket if it is still required. Work was just very hectic the last time you asked, and I haven't had a chance to look into this again until now.
     
  4. itsmikeu

    itsmikeu

    Joined:
    Jan 12, 2022
    Posts:
    10
    Has there been any new information about this issue?
     
  5. wrossmck-unity

    wrossmck-unity

    Unity Technologies

    Joined:
    Nov 9, 2021
    Posts:
    87
    Hi @itsmikeu, auto detect unity version works as expected. I created a test project and was able to get it to work using UVC.

    If you want additional support please create a support ticket where we can look into your specific project and build target configurations.
     

    Attached Files: