-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
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
- Create a standard Flutter project with iOS support
- Configure signing credentials in Xcode (development team, provisioning profile)
- Connect a physical iOS device
- Run
flutter build iosor use Xcode to build for device - Observe the build failure during code signing phase
Root Cause Analysis
Through verbose build logging and investigation, the issue occurs because:
- Flutter's unpacking phase (
debug_unpack_ios/release_unpack_ios) extracts the Flutter engine binary - Extended attributes are added during extraction (specifically
com.apple.provenance) - Flutter itself attempts xattr removal via
xattr -r -d com.apple.FinderInfocommands, but this fails silently - Xcode's code signing validation then rejects the binary due to the presence of these xattrs
- 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
- Manual xattr verification:
xattr -lon built Flutter.framework showscom.apple.provenancepresent - Manual removal works temporarily:
xattr -d com.apple.provenanceallows one build to pass - Issue is not version-specific: Tested with Flutter 3.19.6, 3.24.5, 3.35.7, 3.40.0 — all fail
- 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
- Is Flutter's xattr removal in the unpacking phase working correctly on macOS 15?
- Has Apple's code signing validation become stricter in Xcode 26.1+?
- Is there a flag or environment variable to disable xattr addition during unpacking?
- 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