xcodebuild clean fails when SwiftPM has been integrated into the app.
flutter config --no-enable-swift-package-manager
flutter create my_app --platforms ios && cd my_app
flutter pub add image_picker
flutter build ios
xattr -l build/ios
- Expected & Actual output: nothing
xattr -l build/ios/iphoneos
- Expected & Actual output: nothing
xattr -l build/ios/Release-iphoneos
- Expected & Actual output:
com.apple.xcode.CreatedByBuildSystem: true
cd ios && xcodebuild clean -scheme Runner -workspace Runner.xcworkspace -configuration Release -sdk iphoneos -destination "generic/platform=iOS" BUILD_DIR="../build/ios"
- Expected & Actual output:
** CLEAN SUCCEEDED **
- If you check
ls ../build/ios, you will see Release-iphoneos was deleted
flutter config --enable-swift-package-manager
cd .. && flutter clean
flutter build ios
xattr -l build/ios
- Expected output: nothing
- Actual output:
com.apple.xcode.CreatedByBuildSystem: true
xattr -l build/ios/iphoneos
- Expected & Actual output: nothing
xattr -l build/ios/Release-iphoneos
- Expected output:
com.apple.xcode.CreatedByBuildSystem: true
- Actual output: nothing
cd ios && xcodebuild clean -scheme Runner -workspace Runner.xcworkspace -configuration Release -sdk iphoneos -destination "generic/platform=iOS" BUILD_DIR="../build/ios"
- Expected output:
** CLEAN SUCCEEDED **
- Actual output:
error: Could not delete `/path/to/my_app/build/ios/Release-iphoneos` because it was not created by the build system and it is not a subfolder of derived data.
note: To mark this directory as deletable by the build system, run `xattr -w com.apple.xcode.CreatedByBuildSystem true /path/to/my_app/build/ios/Release-iphoneos` when it is created.
** CLEAN FAILED **
This is a problem for Flutter because we use clean when engine headers change:
|
// Xcode 26 changed the way headers are pre-compiled and will throw an error if the headers |
|
// have changed since the last time they were compiled. To avoid this error, clean before |
|
// building if headers have changed. |
|
targetBuildDir.deleteSync(recursive: true); |
|
buildCommands.addAll(<String>['clean', 'build']); |
xcodebuild cleanfails when SwiftPM has been integrated into the app.flutter config --no-enable-swift-package-managerflutter create my_app --platforms ios && cd my_appflutter pub add image_pickerflutter build iosxattr -l build/iosxattr -l build/ios/iphoneosxattr -l build/ios/Release-iphoneoscom.apple.xcode.CreatedByBuildSystem: truecd ios && xcodebuild clean -scheme Runner -workspace Runner.xcworkspace -configuration Release -sdk iphoneos -destination "generic/platform=iOS" BUILD_DIR="../build/ios"** CLEAN SUCCEEDED **ls ../build/ios, you will seeRelease-iphoneoswas deletedflutter config --enable-swift-package-managercd .. && flutter cleanflutter build iosxattr -l build/ioscom.apple.xcode.CreatedByBuildSystem: truexattr -l build/ios/iphoneosxattr -l build/ios/Release-iphoneoscom.apple.xcode.CreatedByBuildSystem: truecd ios && xcodebuild clean -scheme Runner -workspace Runner.xcworkspace -configuration Release -sdk iphoneos -destination "generic/platform=iOS" BUILD_DIR="../build/ios"** CLEAN SUCCEEDED **This is a problem for Flutter because we use
cleanwhen engine headers change:flutter/packages/flutter_tools/lib/src/ios/mac.dart
Lines 313 to 317 in eb69f48