Analysis and Solutions for 'Build Input File Cannot Be Found' After Upgrading to Xcode 10

Nov 28, 2025 · Programming · 13 views · 7.8

Keywords: Xcode Upgrade | Build Error | File Reference

Abstract: This article provides an in-depth analysis of the 'Build input file cannot be found' error following Xcode 10 upgrades, focusing on compatibility issues between the new build system and legacy projects. It outlines the core solution of switching to the Legacy Build System, supplemented by file reference fixes and project cleaning methods. Referencing similar upgrade issues, the paper helps developers understand Xcode's build mechanisms for smooth project migration.

Problem Background and Error Analysis

After upgrading to Xcode 10, many developers encounter build failures with errors such as: Build input file cannot be found: '/Users/call01/Library/Developer/Xcode/DerivedData/Comp-Lite-Apps-gytvmossqptokeafrddvvmnlzadk/Build/Products/Debug-iphoneos/SG11.app/SG11'. This error points to missing application files in the derived data directory, though the project built successfully before the upgrade. It suggests issues related to Xcode 10's new build system or changes in file management.

Core Solution: Switch to Legacy Build System

Based on best practices, the primary solution is to revert to the Legacy Build System. Steps include: In Xcode, navigate to File > Project Settings > Workspace Settings, then select Legacy Build System. This change bypasses potential compatibility problems in the new system, as the legacy system handles traditional project structures more reliably. Many developers resolve the build error immediately after this adjustment, avoiding the need to downgrade Xcode.

Supplementary Solutions: File Reference Fixes

If switching the build system does not work, the issue may stem from incorrect file references. When files are moved or deleted in the project, Xcode might lose track of their paths. Fix this by: Selecting the project in the project navigator, going to the Build Phases tab, and inspecting files in the Compile Sources section that are causing errors. If paths are wrong, remove them using the minus icon, then re-add files via the plus icon. Afterward, perform Product > Clean Build Folder to clean the build folder and rebuild the project. Additionally, checking for red files in the Recovered References folder, deleting and re-adding them can resolve similar issues.

In-Depth Analysis and Preventive Measures

Referencing similar problems in Xcode 14, such as missing generated files in react-native-config projects post-upgrade, it is evident that version upgrades often introduce changes in build scripts or output file handling. In Xcode 10, the new build system may optimize dependency management and caching but fail to handle derived data from old projects correctly. Developers should back up projects before upgrading and test build processes incrementally. Regularly cleaning derived data (via the DerivedData directory) can prevent such issues. Understanding Xcode's build phases and file reference mechanisms aids in quick diagnosis and resolution of compatibility problems.

Code Examples and Best Practices

Here is a simple script example for automating derived data cleanup to reduce manual errors:

#!/bin/bash
# Clean Xcode derived data
echo "Cleaning Xcode DerivedData..."
rm -rf ~/Library/Developer/Xcode/DerivedData/*
echo "DerivedData cleaned successfully."

Save this script as clean_derived_data.sh and run bash clean_derived_data.sh in the terminal to quickly clear cache data that might cause file-not-found errors. Combined with regular project maintenance, this significantly improves stability during Xcode upgrades.

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.