Search Unity

executeMethod class 'PerformBuild' could not be found.

Discussion in 'Editor & General Support' started by dylan.ryan, Jan 15, 2014.

  1. dylan.ryan

    dylan.ryan

    Joined:
    Oct 15, 2012
    Posts:
    29
    Hello, We have been executing our build by command line, and have just upgraded to Unity 4.3.3 from Unity 4.2.2. When we upgraded we are now getting the following error:

    executeMethod class 'PerformBuild' could not be found.
    Argument was -executeMethod PerformBuild.CommandLineBuild


    The class exists, CommandLineBuild is a static method, and the class's location has not changed. Is there something new in 4.3.3. that changed?

    Thank you,
    Dylan
     
    tigerleapgorge likes this.
  2. dylan.ryan

    dylan.ryan

    Joined:
    Oct 15, 2012
    Posts:
    29
    It looks like the problem is if you specify the -buildtarget parameter. I am guessing this was changed in 4.3.3 to run the build target switching first which was causing it to have problems loading the custom -executeMethod class parameter.
     
    tigerleapgorge likes this.
  3. tonyxu123

    tonyxu123

    Joined:
    Apr 8, 2014
    Posts:
    3
    Hi Dylan,

    how did you end up fixing this issue? I am having a similar issue where my class exists but i'm getting

    executeMethod class 'AutoBuild' could not be found.
    Argument was -executeMethod AutoBuild.PerformBuild

    and I didn't specify a build target.

    If you have any insights that would be extremely helpful, thank you!
     
    tigerleapgorge likes this.
  4. aiwo

    aiwo

    Joined:
    Feb 6, 2014
    Posts:
    2
    If someone encounters the same problem here is my suggestion. I've managed to solve this error by adding full namespace to the class name. I.e. UnityTools.Awesome.AutoBuild.PerformBuild
     
    Pixels_Heart and tigerleapgorge like this.
  5. Killhatch

    Killhatch

    Joined:
    Aug 21, 2012
    Posts:
    4
    Make sure your enclosing class is NOT static!

    I made the mistake of making a public static method inside a public static class.
     
  6. ShadowLiu

    ShadowLiu

    Joined:
    Aug 30, 2012
    Posts:
    17
    However,update to 5.3.4f1 this problem happen again. Anyone help?
     
    tigerleapgorge likes this.
  7. Vitalii_lab

    Vitalii_lab

    Joined:
    Apr 18, 2016
    Posts:
    7
    Yep, i had also faced same issue, but as @aiwo said, use the class name with a namespace - that fixes a problem for me.
     
    Last edited: Apr 18, 2016
    tigerleapgorge likes this.
  8. frank-ijsfontein

    frank-ijsfontein

    Joined:
    Sep 11, 2015
    Posts:
    16
    I had this problem just now on 5.5.0 and it turned out some other classes were missing (forgot to add them to version control). Adding them fixed it. So it was not actually a problem of the buildtarget's class not being there.
     
    tigerleapgorge likes this.
  9. erika-gutierrez

    erika-gutierrez

    Joined:
    Jun 18, 2014
    Posts:
    1
    I have the same problem, any solution?
     
  10. ESG-Steven

    ESG-Steven

    Joined:
    Mar 18, 2015
    Posts:
    38
    Add a namespace to your class (and your execute method cmd param) and make sure it is not static.
    Seems ridiculous but that's what I had to do to make it work, it was no error in my command.
     
  11. g-ericso

    g-ericso

    Joined:
    Mar 27, 2017
    Posts:
    3
    I tried all of above. Nothing works. I am using the latest Unity 2017.2.0.0f3.
     
  12. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    178
    I'm using Unity 2017.2.0.0f3 and managed to fix the issue like so :

    1 - Your "Build class" should be NOT STATIC
    2 - Add a namespace to your "Build Class" and call it with the full namespace in command line.
    3 - Dont forrget to add -projectPath to your command line

    hop that help ;)
     
  13. ESG-Steven

    ESG-Steven

    Joined:
    Mar 18, 2015
    Posts:
    38
    I was in the process of making a build pipeline and initially did notice that my default environment had editor/compiler errors in the project when done through the pipeline. Unfortunately, this spits out the error: "executeMethod class 'MyBuildClass' could not be found."

    It's a very misleading error that seems to be the fallback for a number of unrelated issues.
     
    tigerleapgorge and Kanthor like this.
  14. turnipinrut

    turnipinrut

    Joined:
    Oct 27, 2014
    Posts:
    13
    Our build script is static and works fine
     
    tigerleapgorge likes this.
  15. mihakinova

    mihakinova

    Joined:
    Jan 6, 2015
    Posts:
    85
    I had the same problem and the reason it was happening in my case was that our CI didn't checkout binary files from LFS properly (which in turn caused a bunch of compile errors in the editor, which were not shown in the CI log) :(

    Make sure your project can be opened in the Unity editor, and that it compiles properly there.
     
    tigerleapgorge likes this.
  16. AndyLangberg

    AndyLangberg

    Joined:
    Jul 6, 2018
    Posts:
    37
    Just had this problem myself. Important point which no one has pointed out yet: While the class should not be static, the method itself DO have to be static, else you get an error saying it can't find the method within the given class.
     
    tigerleapgorge likes this.
  17. Carry_Rocky

    Carry_Rocky

    Joined:
    Apr 24, 2019
    Posts:
    13
    I met the same problem in 2018.4.17f1, I solved it by changing the .net version to 4.5 (our version was 3.5).
    PS: static class and function works fine to me, what I changed is only .net version
     
  18. kmithun9

    kmithun9

    Joined:
    May 13, 2019
    Posts:
    5
    Hi where did you change your net version?
     
  19. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    Nothing helped for 2021.2.8f1
     
  20. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    Finally. Make sure the class you use inherits from MonoBehaviour. This was the only solution for me. My class was non-static.
     
  21. munkbusiness

    munkbusiness

    Joined:
    Aug 22, 2017
    Posts:
    55
    I ran into this today. I had been using my builder for 2 years without issues. Then I added one more class inside my builder following the same structure as before (literally just copied a method renamed it and changed the build options), and now for whatever reason my bat file cannot find the builder anymore, and I have tried all suggestions in here to no luck.

    I restarted my PC, discarded my changes in git and tested the old methods and luckily they worked again. I added my new method again and now it works. I am convinced, that it is pure luck whether this works or not, just try things on/off, rename some stuff, restart your pc, ect. until it works.

    For me this is what works:
    • no namespace
    • No MonoBehavior inheritance
    • normal class for the builde aka. not static
    • static methods
    • Version: 2019.2.21f1
     
  22. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Or a combination where you have misspelled the command line argument :) Then Unity will just open your most recent project, which could lead to the `executeMethod class X could not be found.` error, since it's loading a different project