Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UnityEditor.BuildPlayerWindow+BuildMethodException: when building Unity project for iOS

I am using Unity 2017.1.Op4 and I keep getting the following error when building the project for iOS:

UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:162 
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:83 
UnityEditor.HostView:OnGUI()

The build folder is also empty. After making a Google search, a few recommended that I change the Product Name in the Player Settings.

Another workaround suggested: Clearing all errors and switching inspector to show Camera's components (it doesn't matter as long as it is not Player Settings window).

Both suggestions didn't work. How can I resolve this issue?

like image 815
SuperHyperMegaSomething Avatar asked Aug 19 '26 13:08

SuperHyperMegaSomething


1 Answers

I just had this problem and solved. I hope this helps the next person with this problem.

My code contained wrong code like here:

 #if UNITY_STANDALONE_WIN || UNITY_EDITOR
        Correct Code Hear
 #elif UNITY_ANDROID || UNITY_IPHONE
        Compiled Error Code Hear
 #else
 #endif
like image 161
Zhang Zy Avatar answered Aug 21 '26 04:08

Zhang Zy