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?
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.
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
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.
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’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
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.
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.
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.
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