-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Steps to reproduce
I'm not sure if this is sufficient to reproduce the problem or not, but here is what I did with my existing project:
- Setup a multi-flavored (Dev, Prod) flutter project along with the associated Schemes in xcode. The Dev scheme supports debugging while the Prod scheme does not.
- Upgrade to latest MacOS/XCode
- Upgrade Flutter from 3.27.4 to 3.32.6
- Build your app (Prod scheme that does not support debugging) that was previously "working fine".
- Notice the error reported: "An error occurred when adding LLDB Init File: Exception: Failed to find correct customLLDBInitFile in LaunchAction for the Scheme in /Users/user/projects/flutter_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Prod.xcscheme."
Luckily, the Dev.xcscheme and Prod.xcscheme files are version controlled, so I can see that something made changes to the Dev.xcscheme but not the Prod.xcscheme. The <TestAction> element in the Dev.xcscheme file was modified (I don't know if this was by xcode or by flutter) such that it now contains the following attribute:
Before upgrade:
<TestAction
buildConfiguration = "Debug-Dev"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>After upgrade
<TestAction
buildConfiguration = "Debug-Dev"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>Similar changes were made to the <LaunchAction> element except the "selectedLauncherIdentifier" was also changed from Xcode.IDEFoundation.Launcher.PosixSpawn to Xcode.DebuggerFoundation.Launcher.LLDB and the customLLDBInitFile was also added. I don't include the LaunchAction snippets here for brevity, and to exclude project identifiers.
I'm not sure what caused this change to be made. I did not consciously or purposefully make this change. But, this change does cause me stupor of thought and questions. For example, Dev.xcsheme and Prod.xcscheme are committed to version control and now Dev.xcsheme references a resource that I have explicitly added to .gitignore (ie: Flutter/ephemeral/). Maybe I should not be doing that? flutter_lldbinit is an auto generated script (by flutter?) so should flutter_lldbinit be added or excluded from version control? Chat GPT suggests it should be excluded from version control, but it doesn't make sense to me to have Dev.xcsheme (which is version controlled) reference a resource that is excluded from version control. I guess I'm getting side tracked explaining some of my questions and confusion about this customLLDBInitFile configuration. I think it would be really helpful to have good documentation regarding these settings and explicitly stating what should and should not be included in version control.
But, back to this issue. My Prod.xcscheme does not support debugging. That should be optimized for production. So, why does the tool (https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/migrations/lldb_init_migration.dart#L229) require the customLLDBInitFile for a shared scheme that does not enable debugging?
Expected results
Build your app (Prod scheme that does not support debugging) successfully without reporting that "An error occurred when adding LLDB Init File...".
Should the LLDB Init File be part of the build process if the scheme does not have debugging enabled?
Actual results
An error occurred when adding LLDB Init File:
Exception: Failed to find correct customLLDBInitFile in LaunchAction for the Scheme in /Users/user/projects/flutter_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Prod.xcscheme.
Code sample
Code sample
N/AScreenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
N/AFlutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.32.6, on macOS 15.5 24F74 darwin-arm64, locale en-US) [403ms]
• Flutter version 3.32.6 on channel stable at /Users/user/fvm/versions/3.32.6
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 077b4a4ce1 (7 days ago), 2025-07-08 13:31:08 -0700
• Engine revision 72f2b18bb0
• Dart version 3.8.1
• DevTools version 2.45.1
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [1,121ms]
• Android SDK at /Users/user/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• ANDROID_SDK_ROOT = /Users/user/Library/Android/sdk
• Java binary at: /Users/user/.sdkman/candidates/java/17.0.13-tem/bin/java
This JDK is specified in your Flutter configuration.
To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment Temurin-17.0.13+11 (build 17.0.13+11)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [759ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16F6
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [79ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2025.1) [79ms]
• Android Studio at /Users/user/Applications/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 21.0.6+-13391695-b895.109)
[✓] IntelliJ IDEA Ultimate Edition (version 2025.1.3) [78ms]
• IntelliJ at /Users/user/Applications/IntelliJ IDEA Ultimate.app
• Flutter plugin version 86.0.2
• Dart plugin version 251.27623
[✓] VS Code (version 1.100.3) [10ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.112.0
[✓] Connected device (4 available) [6.5s]
<redacted>
[✓] Network resources [246ms]
• All expected network resources are available.
• No issues found!