executeMethod class 'PerformBuild' could not be found.

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

1 Like

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.

1 Like

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!

2 Likes

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

2 Likes

Make sure your enclosing class is NOT static!

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

However,update to 5.3.4f1 this problem happen again. Anyone help?

1 Like

Yep, i had also faced same issue, but as @aiwo said, use the class name with a namespace - that fixes a problem for me.

1 Like

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.

1 Like

I have the same problem, any solution?

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.

I tried all of above. Nothing works. I am using the latest Unity 2017.2.0.0f3.

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 :wink:

3 Likes

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.

3 Likes

Our build script is static and works fine

1 Like

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) :frowning:

Make sure your project can be opened in the Unity editor, and that it compiles properly there.

1 Like

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.

1 Like

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

Hi where did you change your net version?

Nothing helped for 2021.2.8f1

Finally. Make sure the class you use inherits from MonoBehaviour. This was the only solution for me. My class was non-static.