Repository: flutter
Issue: [XCode15] Target debug_unpack_ios failed: Exception: Failed to codesign /build/ios/Debug-iphoneos/Flutter.framework/Flutter with identity
Labels: platform-ios,tool,t: xcode,e: OS-version specific,P2,team-ios,triaged-ios

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

```flutter create --project-name=abc .```
Essentially create a standard flutter project.

I am currently running iOS17 and XCode 15 Beta 4, and I am unable to run the application at all on an iOS device. After seeing issue #123583, I think this is related in some way. This specific folder does not sync with any cloud storage services, so that's not the issue, but the error I am getting is essentially the same. The main error seems to be ```build/ios/Debug-iphoneos/Flutter.framework/Flutter: resource fork, Finder information, or similar detritus not allowed```, but I am not 100% sure.

### Expected results

Be able to build it and run it

### Actual results

```
Could not build the precompiled application for the device.

Error (Xcode): Target debug_unpack_ios failed: Exception: Failed to codesign /Users/chandraadityaputrevu/Desktop/LOMP.nosync/apps/leadsmh/build/ios/Debug-iphoneos/Flutter.framework/Flutter with identity [identity].
```

### Code sample

This is the standard starting project:
```
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // TRY THIS: Try running your application with "flutter run". You'll see
        // the application has a blue toolbar. Then, without quitting the app,
        // try changing the seedColor in the colorScheme below to Colors.green
        // and then invoke "hot reload" (save your changes or press the "hot
        // reload" button in a Flutter-supported IDE, or press "r" if you used
        // the command line to start the app).
        //
        // Notice that the counter didn't reset back to zero; the application
        // state is not lost during the reload. To reset the state, use hot
        // restart instead.
        //
        // This works for code too, not just values: Most code changes can be
        // tested with just a hot reload.
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // TRY THIS: Try changing the color here to a specific color (to
        // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
        // change color while the other colors stay the same.
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          //
          // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
          // action in the IDE, or press "p" in the console), to see the
          // wireframe for each widget.
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
```

### Screenshots or Video

_No response_

### Logs

<details><summary>Logs</summary>

```console
                     ♦ /Users/chandraadityaputrevu/Development/flutter/bin/flutter --verbose assemble --no-version-check
                     --output=/Users/chandraadityaputrevu/Desktop/TestF/build/ios/Debug-iphoneos/ -dTargetPlatform=ios
                     -dTargetFile=/Users/chandraadityaputrevu/Desktop/TestF/lib/main.dart -dBuildMode=debug -dIosArchs=arm64
                     -dSdkRoot=/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -dSplitDebugInfo=
                     -dTreeShakeIcons=false -dTrackWidgetCreation=true -dDartObfuscation=false -dAction=build --ExtraGenSnapshotOptions=
                     --DartDefines=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC9jZGJl
                     ZGE3ODhhMjkzZmEyOTY2NWRjM2ZhM2Q2ZTYzYmQyMjFjYjBkLw== --ExtraFrontEndOptions= -dCodesignIdentity=42BD4D039AF5670416543BBA7486C35F68C90386
                     debug_ios_bundle_flutter_assets
                     [   +2 ms] executing: [/Users/chandraadityaputrevu/Development/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
                     [  +20 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
                     [        ] f468f3366c26a5092eb964a230ce7892fda8f2f8
                     [        ] executing: [/Users/chandraadityaputrevu/Development/flutter/] git tag --points-at f468f3366c26a5092eb964a230ce7892fda8f2f8
                     [  +23 ms] Exit code 0 from: git tag --points-at f468f3366c26a5092eb964a230ce7892fda8f2f8
                     [        ] 3.10.6
                     [   +2 ms] executing: [/Users/chandraadityaputrevu/Development/flutter/] git rev-parse --abbrev-ref HEAD
                     [  +10 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
                     [        ] stable
                     [  +14 ms] executing: [/Users/chandraadityaputrevu/Development/flutter/] git rev-parse --abbrev-ref --symbolic @{upstream}
                     [  +10 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{upstream}
                     [        ] origin/stable
                     [        ] executing: [/Users/chandraadityaputrevu/Development/flutter/] git ls-remote --get-url origin
                     [  +10 ms] Exit code 0 from: git ls-remote --get-url origin
                     [        ] https://github.com/flutter/flutter.git
                     [   +6 ms] executing: sysctl hw.optional.arm64
                     [   +6 ms] Exit code 1 from: sysctl hw.optional.arm64
                     [        ] sysctl: unknown oid 'hw.optional.arm64'
                     [  +48 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
                     [   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
                     [  +98 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
                     [        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
                     [        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
                     [   +1 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
                     [        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
                     [        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
                     [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
                     [        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
                     [  +25 ms] Initializing file store
                     [   +6 ms] Done initializing file store
                     [  +49 ms] debug_unpack_ios: Starting due to {}
                     [  +34 ms] Skipping lipo for non-fat file /Users/chandraadityaputrevu/Desktop/TestF/build/ios/Debug-iphoneos/Flutter.framework/Flutter
                     [  +50 ms] Skipping target: gen_localizations
                     [   +6 ms] Skipping target: gen_dart_plugin_registrant
                     [ +393 ms] Skipping target: kernel_snapshot
                     [   +3 ms] Persisting file store
                     [  +11 ms] Done persisting file store
                     [  +13 ms] "flutter assemble" took 711ms.
                     [   +9 ms] ensureAnalyticsSent: 0ms
                     [        ] Running 0 shutdown hooks
                     [        ] Shutdown hooks complete
                     [   +1 ms] exiting with code 1
                     error: [   +8 ms] Target debug_unpack_ios failed: Exception: Failed to codesign
                     /Users/chandraadityaputrevu/Desktop/TestF/build/ios/Debug-iphoneos/Flutter.framework/Flutter with identity 42BD4D039AF5670416543BBA7486C35F68C90386.
                                /Users/chandraadityaputrevu/Desktop/TestF/build/ios/Debug-iphoneos/Flutter.framework/Flutter: replacing existing signature
                                /Users/chandraadityaputrevu/Desktop/TestF/build/ios/Debug-iphoneos/Flutter.framework/Flutter: resource fork, Finder information, or similar
                                detritus not allowed

                                #0      _signFramework (package:flutter_tools/src/build_system/targets/ios.dart:725:5)
                                #1      UnpackIOS.build (package:flutter_tools/src/build_system/targets/ios.dart:299:5)
                                #2      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:847:27)
                                <asynchronous suspension>
                                #3      Future.wait.<anonymous closure> (dart:async/future.dart:525:21)
                                <asynchronous suspension>
                                #4      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:785:32)
                                <asynchronous suspension>
                                #5      Future.wait.<anonymous closure> (dart:async/future.dart:525:21)
                                <asynchronous suspension>
                                #6      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:785:32)
                                <asynchronous suspension>
                                #7      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:614:16)
                                <asynchronous suspension>
                                #8      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:315:32)
                                <asynchronous suspension>
                                #9      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1336:27)
                                <asynchronous suspension>
                                #10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
                                <asynchronous suspension>
                                #11     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
                                <asynchronous suspension>
                                #12     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:296:9)
                                <asynchronous suspension>
                                #13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
                                <asynchronous suspension>
                                #14     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:244:5)
                                <asynchronous suspension>
                                #15     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:91:9)
                                <asynchronous suspension>
                                #16     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
                                <asynchronous suspension>
                                #17     main (package:flutter_tools/executable.dart:91:3)
                                <asynchronous suspension>

                     [   +3 ms] 
                                #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
                                #1      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:332:7)
                                <asynchronous suspension>
                                #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1336:27)
                                <asynchronous suspension>
                                #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
                                <asynchronous suspension>
                                #4      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
                                <asynchronous suspension>
                                #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:296:9)
                                <asynchronous suspension>
                                #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
                                <asynchronous suspension>
                                #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:244:5)
                                <asynchronous suspension>
                                #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:91:9)
                                <asynchronous suspension>
                                #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
                                <asynchronous suspension>
                                #10     main (package:flutter_tools/executable.dart:91:3)
                                <asynchronous suspension>
                     Failed to package /Users/chandraadityaputrevu/Desktop/TestF.
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.10.6, on macOS 14.0 23A5286i darwin-x64, locale en-IN)
    • Flutter version 3.10.6 on channel stable at /Users/chandraadityaputrevu/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (2 days ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/chandraadityaputrevu/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/JetBrains/apps/AndroidStudio/ch-0/223.8836.35.2231.10320515/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode-beta.app/Contents/Developer
    • Build 15A5195m
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/JetBrains/apps/AndroidStudio/ch-0/223.8836.35.2231.10320515/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] Connected device (3 available)
    • Chandraaditya’s iPhone (mobile) • 00008030-001A49921A02802E • ios            • iOS 17.0 21A5277j
    • macOS (desktop)                 • macos                     • darwin-x64     • macOS 14.0 23A5286i darwin-x64
    • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 114.0.5735.198

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>