Search Issue Tracker
Won't Fix
Votes
1
Found in
2022.3.16f1
2023.2.4f1
2023.3.0b1
Issue ID
UUM-59574
Regression
Yes
"Unexpected duplicate tasks" error in Xcode when the project is rebuilt
Reproduction steps:
1. Open the attached project “ReproProj”
2. Go to File > Build Settings and choose iOS build target
3. Make sure that the build uses Xcode 15.x and press Build And Run
4. Wait for the build to finish
5. In the opened Xcode project, if needed, change Xcode scheme to “UnityFramework” and press the Build button
6. Go back to Editor and press CMD+B
7. Press the Build button in Xcode
8. Observe Xcode logs
Expected result: Xcode Build succeeds
Actual result: Xcode Build fails with “Unexpected duplicate tasks” error
Reproducible with: 2022.2.21f1, 2022.3.16f1, 2023.2.4f1, 2023.3.0b1
Not reproducible with: 2021.3.34f1, 2022.1.24f1, 2022.2.0a13
Couldn't test 2022.2.0a14 - 2022.2.20f1 (“BuildFailedException: Incremental Player build failed!”)
Reproducible on: macOS 14.2 (M1 Max), macOS 14.0 (Intel)
Not reproducible on: No other environment tested
Note: As a workaround, from the second time on, build the project from the Build Settings window using Build And Run and selecting the "Replace" option when prompted by macOS
Comments (10)
-
micahxavier2018
Apr 17, 2025 02:46
Same here, this bug is messing up my ability to “quickly” build and test for iOS. I’m using macOS sequoia 15.4, Xcode 16.2. Unity 6000.0.43f1. I build the Xcode project in windows and build the iOS with Xcode
-
eduardooriz
Apr 10, 2025 15:07
You can just go on Xcode to GameAssembly > Build Phases and delete one of the duplicated run scripts (garbage bin icon) the team seems aware of this bug
-
ccoppoletti
Apr 08, 2025 19:25
This happened to me after building for iOS Simulator SDK then trying to append over a project I built. It is not resolved in 2022.3.45f1
-
artfail
Apr 07, 2025 02:04
Same issue. Xcode 16.3, Unity 6000.0.45
-
artfail
Apr 06, 2025 02:25
I am also hitting this issue with Xcode 16.3. I tried with both Unity 6.0.44 and 6.0.45
-
artfail
Apr 05, 2025 21:38
I am ALSO experiencing this with Xcode 16.3 and Unity 6000.00.44f1.
-
fred_unity188
Apr 05, 2025 12:01
Same issue here. From Unity's answer, I don't quite get what we're supposed to do as a workaround
-
sama-van
Apr 03, 2025 17:02
Temp fix:
1. Delete the whole Xcode project.
2. rm -rf ~/Library/Caches/com.apple.dt.Xcode
3. rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache
4. Restart machine.
5. Build from Unity again. -
sama-van
Apr 03, 2025 16:36
Same issue with Unity 6000.0.44F1 & xcode Version 16.2.
-
pstpetrov
Apr 03, 2025 14:36
I am experiencing this with Xcode 16.3, Unity 6000.00.44f1. Is there a workaround?
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Foldout arrow indent is misaligned in the Inspector when used in Custom Type
- [Android] The Player screen turns black when playing a video under certain conditions
- Search window icons at the bottom are cut off when Search window is resized vertically
- "Try something else?" text label is cut off when searching for a long text in the Search window
- Rendering Debugger window sections do not have a minimum width set when resizing with the slider in the middle of the window
Resolution Note:
There is an issue with postprocess script, where shell script build phase is edited manually:
if (section == "PBXShellScriptBuildPhase" && line.Trim().StartsWith("shellScript"))
{
pbxproj.Flush();
pbxproj.BaseStream.Seek(-2L - Environment.NewLine.Length, SeekOrigin.Current);
pbxproj.WriteLine("\\necho \\\"Hello\\\"\";");
}
What is happening, is that we add shell script in GameAssembly to run il2cpp build.
Now, we really need il2cpp build properly done, so we always add this run script phase with proper commandline etc.
This works in both replace and append, since internally (in PBXProject) when adding shellscript phase, we are checking first if such phase exists already (by comparing name/commandline/some other things), see https://docs.unity3d.com/ScriptReference/iOS.Xcode.PBXProject.AddShellScriptBuildPhase.html
Since pbxproject *text* itself is edited, when we load it to append, the buildphase that GameAssembly needs is different from what is in the project, so it is added anew. And mind you we cannot just delete previous one because this is, kinda, no longer "unity added it and controls it"