Error building player because build target was unsupported

I’m trying to find the source of this error when building. I am testing Unity2018.2.11f1 to see if it will work for us. I have targeted iOS and Android in separate builds but got the same error. In my searching people are suggesting that I have not installed the correct platforms in Unity, but I’m certain that I have:

What else could be causing this?

I am building through a script calling:

            var buildReport = BuildPipeline.BuildPlayer(buildPlayerOption);
            if (buildReport.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded)
            {
                // Log some stuff
                Console.WriteLine("Target: " + buildPlayerOption.target);
                Console.WriteLine("TargetGroup: " + buildPlayerOption.targetGroup);
                Console.WriteLine("Options: " + buildPlayerOption.options.ToString());
                Console.WriteLine("Scene Count: " + buildPlayerOption.scenes.Length);
                Console.WriteLine("LocationPathName: " + buildPlayerOption.locationPathName);
                Console.WriteLine("==============================");
                Console.WriteLine(buildReport.name);
                Console.WriteLine("Platform: " + buildReport.summary.platform);
                Console.WriteLine("PlatformGroup: " + buildReport.summary.platformGroup);
                Console.WriteLine("Result: " + buildReport.summary.result);
                Console.WriteLine("Total Warnings " + buildReport.summary.totalWarnings);
                Console.WriteLine("Total errors " + buildReport.summary.totalErrors);


                throw new Exception("Build failed: " + buildReport.summary.totalErrors);
            }

This is my output:

Target: iOS
TargetGroup: iOS
Options: Development, AllowDebugging
Scene Count: 2
LocationPathName: /Users/admin/jenkins_node/workspace/Unity-Arcade/…/XCode

New Report
Platform: iOS
PlatformGroup: iOS
Result: Failed
Total Warnings 0
Total errors 1
Exception: Build failed: 1

1 Like

Any suggestions on this? If I build by manually clicking the ‘build’ button it works fine, it just fails when I try to use our Jenkins build system.

I figured I should add our executed command line argument that results in this failure (I’ve replaced sensitive information):
/Applications/Unity2018.2.1f1/Unity.app/Contents/MacOS/Unity -projectPath /Users/*******/jenkins_node/workspace/Unity-Game -buildTarget android -quit -nographics -batchmode -logFile /dev/stdout -executeMethod BuildSystem.Build -target android -version 2018.0.0 -buildcode 1000000 -config qa -branch update/unity2018 -keystore-password ************** -keychainPassword ************** -team-id **************

Did you try Android vs android? It might be case sensitive. Unity - Manual: Command-line arguments

Thank you for the reply, and yes, I have tried with both Android and android as well as iOS/IOS/ios.

It is not case sensitive.

I am also experiencing the same behavior on 2018.3.8f1 on my build server and have not been able to find a solution.

I may have discovered a work-around. I changed setting it with “iOS” and “iOS” to the enum int values like this:

buildPlayerOptions.target = (BuildTarget)9;
buildPlayerOptions.targetGroup = (BuildTargetGroup)4;

and I seem to be getting working builds now.