Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Xcode says it has no rule to process a file that is in Compile Sources

Errorwarning: no rule to process file

Short answer

For each file in the Compile Sources phase Xcode looks up a build rule by file type. This warning means one of those files has a type no rule can compile. Read the path in the warning, then remove the file from Compile Sources. Headers belong in the Headers phase, resources in Copy Bundle Resources, and a real custom type needs its own build rule.

  • Applies to Xcode 26, macOS 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Build once and keep only the warning lines. Each one carries the full path of the file, and the folder it sits in often tells you which kind of file it is.

    xcodebuild -project MyApp.xcodeproj -scheme MyApp build 2>&1 | grep "no rule to process file"
  2. 2Match what you see, then jump to its fix

    1. 1The path in the warning ends in .h or .hpp.A header file is listed in Compile SourcesFix
    2. 2The path ends in .json, .txt, .md, .plist or a similar extension: a file the app may need to carry, not code.A resource or data file is listed in Compile SourcesFix
    3. 3The file has to be processed at build time (a template, a schema or a recipe your own tool turns into code or data) and its extension is not one Xcode knows.A genuine source file has a custom type that no build rule coversFix

What does the error look like?

  • warning: no rule to process file
  • no rule to process file '/path/to/File.h' of type <file type> for architecture <arch>

Cause 1 of 3

A header file is listed in Compile Sources

1Check

Open the target, go to Build Phases and expand Compile Sources, which lists the source files Xcode compiles. A header has nothing to compile. The Headers phase is the place where Xcode associates header files with a target.

# Xcode: select the target > Build Phases > Compile Sources, then type .h in the filter

2Fix

Select the header in Compile Sources and press the minus button. If the header is part of a framework's API, add it to the Headers phase instead, in the Public, Private or Project section.

# Compile Sources: select the .h entry, click the minus (-) button
# Framework API headers: Build Phases > Headers > drag the file to Public, Private or Project

3Verify

Build again. The count of matching lines should be 0.

xcodebuild -project MyApp.xcodeproj -scheme MyApp build 2>&1 | grep -c "no rule to process file"

Confirmed by developer.apple.com

Did this fix it?

Cause 2 of 3

A resource or data file is listed in Compile Sources

1Check

Compile Sources holds source files to compile, so a data file there gets no compile rule. The phase that carries files into the finished app is Copy Bundle Resources, which copies them to the bundle's resource directory.

# Xcode: target > Build Phases > Compile Sources and Copy Bundle Resources, compare the two lists

2Fix

Remove the file from Compile Sources. If the app reads it at run time, add it to Copy Bundle Resources. If it is only a note or a developer tool, keep it out of every phase. Never add the target's Info.plist to Copy Bundle Resources: Xcode processes it from the INFOPLIST_FILE setting on its own.

# Compile Sources: select the file, click the minus (-) button
# Copy Bundle Resources: click the plus (+) button, add the file

3Verify

Build again and confirm the warning no longer prints.

xcodebuild -project MyApp.xcodeproj -scheme MyApp build 2>&1 | grep -c "no rule to process file"

Confirmed by developer.apple.com

Did this fix it?

Cause 3 of 3

A genuine source file has a custom type that no build rule covers

1Check

Xcode chooses the tool for every file from the built-in build rules or the project's own. Open the target's Build Rules tab and look for a rule whose pattern matches the file.

# Xcode: select the target > Build Rules tab

2Fix

Add a rule: click plus, set Process to source files with names matching your pattern, and give a script or an existing tool. The script reads the input path from SCRIPT_INPUT_FILE. Declare the output under DERIVED_FILE_DIR, so Xcode knows when to rebuild.

# Build Rules > +
# Process: Source files with names matching   *.recipe
# Output Files: $(DERIVED_FILE_DIR)/$(INPUT_FILE_BASE).compiledData
# Script (compile-recipe is your own tool):
"$SRCROOT/tools/compile-recipe" "$SCRIPT_INPUT_FILE" "$SCRIPT_OUTPUT_FILE_0"

3Verify

Build again. The warning is gone and the declared output file exists in the derived files folder.

xcodebuild -project MyApp.xcodeproj -scheme MyApp build 2>&1 | grep -c "no rule to process file"

Confirmed by developer.apple.com

Did this fix it?

How do I stop it coming back?

  • After adding a file to a target, open Build Phases and check which list it landed in: code in Compile Sources, resources in Copy Bundle Resources, framework API headers in Headers.
  • Keep notes, scripts and other developer-only files out of every build phase.
  • Leave Info.plist out of Copy Bundle Resources.
  • Count this warning in the build log as a to-do: a file in the wrong phase can mean a resource is missing from the app.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Mobile apps

App record creation fails because you lack permission

You cannot add a new app in App Store Connect as a Developer or limited user

Only the Account Holder, an Admin or an App Manager can create an app record, and Apple blocks it until the Account Holder has signed the latest agreement.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.