Skip to content

Failure to codesign iOS app due to xattr issue #180351

@BGB2121

Description

@BGB2121

Flutter iOS Code Signing xattr Issue - Bug Report

Title

iOS Release Build Fails with Code Signing Error: "resource fork, Finder information, or similar detritus not allowed" (xattr com.apple.provenance)

Environment

  • macOS Version: 15.2 (Sonoma)
  • Xcode Version: 26.1.1 (Build 17B100)
  • Flutter Version Tested: 3.38.5 (stable), 3.40.0 (beta), 3.35.7, 3.24.5, 3.19.6
  • Dart Version: 3.10.4 (varies by Flutter version)
  • Target Device: Physical iPhone (iOS 15.0+)
  • Build Configuration: Release (ios-release)

Description

When building Flutter iOS apps for physical device deployment, the build fails during the release_unpack_ios phase with a code signing error. The error message indicates that extended attributes (xattr) are present on the Flutter.framework binary, specifically com.apple.provenance, which Apple's code signing tool rejects.

Error Message

Target release_unpack_ios failed: Exception: Failed to codesign /path/to/build/ios/Release-iphoneos/Flutter.framework/Flutter with identity [CERT_ID].
/path/to/build/ios/Release-iphoneos/Flutter.framework/Flutter: replacing existing signature
/path/to/build/ios/Release-iphoneos/Flutter.framework/Flutter: resource fork, Finder information, or similar detritus not allowed
Failed to package [app name].
Command PhaseScriptExecution failed with a nonzero exit code

Steps to Reproduce

  1. Create a standard Flutter project with iOS support
  2. Configure signing credentials in Xcode (development team, provisioning profile)
  3. Connect a physical iOS device
  4. Run flutter build ios or use Xcode to build for device
  5. Observe the build failure during code signing phase

Root Cause Analysis

Through verbose build logging and investigation, the issue occurs because:

  1. Flutter's unpacking phase (debug_unpack_ios/release_unpack_ios) extracts the Flutter engine binary
  2. Extended attributes are added during extraction (specifically com.apple.provenance)
  3. Flutter itself attempts xattr removal via xattr -r -d com.apple.FinderInfo commands, but this fails silently
  4. Xcode's code signing validation then rejects the binary due to the presence of these xattrs
  5. The error is fatal — code signing cannot proceed with xattrs present

What Has Been Attempted (All Failed)

  • ✅ Cleaning Flutter SDK cache and xattrs manually — xattrs are re-added during unpacking
  • ✅ Podfile post_install hooks to clean xattrs — too late, unpacking occurs after pod install
  • ✅ Custom Xcode build phases (pre/post signing) — file timing issues, can't intercept unpacking
  • ✅ Build settings modifications — no setting controls xattr validation
  • ✅ Multiple Flutter versions (3.19.6 → 3.40.0) — issue persists across all versions
  • ✅ Xcode 26.1.1 (which reportedly worked in previous sessions) — still fails
  • ✅ Manual xattr removal during build — doesn't persist, re-added on next invocation

Evidence

  1. Manual xattr verification: xattr -l on built Flutter.framework shows com.apple.provenance present
  2. Manual removal works temporarily: xattr -d com.apple.provenance allows one build to pass
  3. Issue is not version-specific: Tested with Flutter 3.19.6, 3.24.5, 3.35.7, 3.40.0 — all fail
  4. Verbose build logs confirm Flutter runs xattr removal commands that fail silently

Impact

  • Blocks iOS physical device testing — can only use simulator
  • Affects all iOS releases — prevents production deployment
  • Workaround-resistant — issue occurs during Xcode unpacking phase before build configuration can intervene

Suspected Root Cause

This appears to be a macOS 15 (Sonoma) + Xcode 26.1+ code signing validation change that now rejects binaries with resource fork/extended attributes that Flutter's unpacking process introduces and fails to remove.

Questions for Flutter Team

  1. Is Flutter's xattr removal in the unpacking phase working correctly on macOS 15?
  2. Has Apple's code signing validation become stricter in Xcode 26.1+?
  3. Is there a flag or environment variable to disable xattr addition during unpacking?
  4. Should xattr removal be retried if initial attempt fails?

Request

  • Investigate why xattr removal fails silently during unpacking
  • Fix xattr handling in Flutter's iOS engine unpacking phase
  • Consider implementing robust xattr cleanup with error handling and retries

Reported by: Greg Barber
Date: 2025-12-28
Project: spend_habit_2 (Flutter iOS app)
**EMAIL bgb2121@yahoo.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-iosiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions