Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Jenkins/Ubuntu - executeMethod class 'UnityBuild' could not be found.

Discussion in 'Testing & Automation' started by TaleOf4Gamers, Oct 20, 2019.

  1. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    I have been battling this error for a couple of days now. I came back to my Jenkins setup after a week where the previous build had succeeded then bam, for some inexplicable reason it now throws this error.

    This is the project I am building: https://github.com/CarlHalstead/Jenkins-Test

    I am at a wits end.

    Here is the most recent log:

    Here is the log of the last successful build:

    Attempting to battle this issue is giving me a migraine so I will be back a little bit to update this post if necessary.
     
  2. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    Here is the command I am now executing I think it is a little different to the last successful build but as far as I can tell it is still running Unity with the same command.

     
  3. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Did you check that you actually have a static method called UnityBuild.BuildPlatforms available in an editor assembly ?
     
  4. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    Definitely, it is right there in my repository and when I check the Workspace through Jenkins it exists in the right place. (Assets/Editor/UnityBuild.cs with a static method called BuildPlatforms). I even made sure to copy/paste the names across and noticed no changes.
     
  5. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Not sure this is related, but the project folder is called "Unity Test" (contains a space character).

    You can try to change that to something without a space (UnityTest).
     
  6. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    I doubt that is the issue (Due to it working previously with the same name) but I will change it nonetheless as it does bug me that it has a space. Will report back if it fixes anything.
     
  7. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    post any updates if u found something :)
     
  8. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    Created a new Jenkins project (Simply called 'Unity'), copied my config over for the most part (Even simplified the command line args a little) and still get the same error.

    UnityBuild.cs is very clearly there and very clearly has a static BuildPlatforms method



    I am at a loss, I just have no idea what has broken it since the last successful build. Or at least what is causing this specific error which sounds straight forward but clearly isn't.
     
  9. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    I have just seen this in the log:

    I wonder if this is related. Strange that the build continues printing messages after this point as if nothing has happened.

    EDIT:

    I am increasing my VM to 2GB of RAM instead of 1GB just for the hell of it to see if it changes anything.
     
  10. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    I could not make this up if I tried. The issue is that it did not have enough RAM to compile the code, hence giving the error that my script did not exist. If there is any way to have a better error message, it would be appreciated! (Or an error message in a sensible location instead of the middle of the log!)

    Note to anyone who reads this in the future: Your machine may need more RAM!
     
  11. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    Personal thanks for trying to help. Without your motivation I may have given up!
     
  12. DimaHubenkoGamepoint

    DimaHubenkoGamepoint

    Joined:
    May 16, 2018
    Posts:
    20
    Okay, so I got the same issue with my build script. The issue appeared directly after updating to latest IAP 2.2.5 in my case.
    I didn't dig into the problem itself. As for me it looks like that Unity is now obfuscating unused scripts BEFORE launching build (maybe only for building via command line, idk). The solution is to use link.xml or [Preserve] attribute.

    https://docs.unity3d.com/2018.3/Documentation/Manual/ManagedCodeStripping.html
     
  13. thitbbeb

    thitbbeb

    Joined:
    Apr 24, 2019
    Posts:
    1
    Have you solved it?

    I also got this issue,

    I need `rm -rf Library` when executeMethod class 'xxxx' could not be found.