Skip to content

Conversation

@flutteractionsbot
Copy link

@flutteractionsbot flutteractionsbot commented Aug 8, 2024

Issue Link:

#152989

Changelog Description:

On Xcode 16 beta, compilation errors are not displayed in the output of flutter run.

Impact Description:

If there are compilation errors flutter build ios/run will fail, but displays the last x lines out the Xcode output instead of a nicely formatted description of the error.

Workaround:

Use Xcode 15.

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

Validation Steps:

Run the following steps with both Xcode 15 and Xcode 16 installed (should behave the same):

$ flutter create test_create
$ cd test_create
$ open ios/Runner/AppDelegate.swift

Add code that would cause a compilation issue:

import Flutter
import UIKit

@main
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    var i = 1 + @""
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}
$ flutter build ios

Output should be:

Failed to build iOS app
Swift Compiler Error (Xcode): String literals in Swift are not preceded by an '@' sign
/Users/m/Projects/test_create/ios/Runner/AppDelegate.swift:9:16


Swift Compiler Error (Xcode): Binary operator '+' cannot be applied to operands of type 'Int' and 'String'
/Users/m/Projects/test_create/ios/Runner/AppDelegate.swift:9:14


Encountered error while building for device.

Workaround to add the `--legacy` flag until flutter#151502 can adopt the non-deprecated usage.

This will allow Xcode errors to be parseable again.

Fixes flutter#152989
@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Aug 8, 2024
@flutteractionsbot
Copy link
Author

@jmagman please fill out the PR description above, afterwards the release team will review this request.

@github-actions github-actions bot added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Aug 8, 2024
...xcode.xcrunCommand(),
'xcresulttool',
'get',
// See https://github.com/flutter/flutter/issues/151502
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you briefly describe it in comment why this is added? so that future readers don't have to click on the link to know what this does.

@itsjustkevin itsjustkevin added autosubmit Merge PR when tree becomes green via auto submit App cp: approved Approved cherry-pick request labels Aug 13, 2024
@auto-submit auto-submit bot merged commit 8997882 into flutter:flutter-3.24-candidate.0 Aug 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 21, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App cp: approved Approved cherry-pick request cp: review Cherry-picks in the review queue platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants