Skip to content

Use Xcode build setting PRODUCT_NAME to find app and archive paths #140242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 22, 2024

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Dec 15, 2023

  1. Instead of getting the FULL_PRODUCT_NAME Xcode build setting (Runner.app) instead use PRODUCT_NAME since most places really want the product name, and the extension stripping wasn't correct when the name contained periods.
  2. Don't instruct the user to open the xcarchive in Xcode if it doesn't exist.

Fixes #140212

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@jmagman jmagman self-assigned this Dec 15, 2023
@github-actions github-actions bot added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Dec 15, 2023
@jmagman jmagman force-pushed the product-name branch 2 times, most recently from be3005f to cb485e6 Compare December 15, 2023 21:34
@jmagman
Copy link
Member Author

jmagman commented Feb 27, 2024

I still need to track down the test failures.

00:19 +1667 ~3 -1: test/general.shard/ios/ios_device_start_nonprebuilt_test.dart: IOSDevice.startApp for CoreDevice in debug mode fails when Xcode workspace is not found [E]                          
  Expected: contains 'Unable to get Xcode workspace'
    Actual: 'Could not find the built application bundle at build/ios/iphoneos/My Super Awesome App.app.app.\n'
              ''
     Which: does not contain 'Unable to get Xcode workspace'
  
  package:matcher                                                      expect
  test/general.shard/ios/ios_device_start_nonprebuilt_test.dart 754:9  main.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  test/src/context.dart 141:26                                         testUsingContext.<fn>.<fn>.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  package:flutter_tools/src/base/context.dart 153:19                   AppContext.run.<fn>
  ===== asynchronous gap ===========================
  package:flutter_tools/src/base/context.dart 153:19                   AppContext.run.<fn>
  ===== asynchronous gap ===========================
  package:flutter_tools/src/base/context.dart 153:19                   AppContext.run.<fn>
  ===== asynchronous gap ===========================
  test/src/context.dart 102:5        
00:20 +1891 ~3 -2: test/general.shard/ios/ios_device_start_nonprebuilt_test.dart: IOSDevice.startApp for CoreDevice in debug mode succeeds [E]                                                         

00:22 +2043 ~3 -3: test/general.shard/ios/ios_device_start_nonprebuilt_test.dart: IOSDevice.startApp for CoreDevice in debug mode with flavor succeeds [E]  

@jmagman
Copy link
Member Author

jmagman commented Apr 30, 2024

I still need to track down the test failures.

00:19 +1667 ~3 -1: test/general.shard/ios/ios_device_start_nonprebuilt_test.dart: IOSDevice.startApp for CoreDevice in debug mode fails when Xcode workspace is not found [E]                          
  Expected: contains 'Unable to get Xcode workspace'
    Actual: 'Could not find the built application bundle at build/ios/iphoneos/My Super Awesome App.app.app.\n'
              ''
     Which: does not contain 'Unable to get Xcode workspace'
  
  package:matcher                                                      expect
  test/general.shard/ios/ios_device_start_nonprebuilt_test.dart 754:9  main.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  test/src/context.dart 141:26                                         testUsingContext.<fn>.<fn>.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  package:flutter_tools/src/base/context.dart 153:19                   AppContext.run.<fn>
  ===== asynchronous gap ===========================
  package:flutter_tools/src/base/context.dart 153:19                   AppContext.run.<fn>
  ===== asynchronous gap ===========================
  package:flutter_tools/src/base/context.dart 153:19                   AppContext.run.<fn>
  ===== asynchronous gap ===========================
  test/src/context.dart 102:5        
00:20 +1891 ~3 -2: test/general.shard/ios/ios_device_start_nonprebuilt_test.dart: IOSDevice.startApp for CoreDevice in debug mode succeeds [E]                                                         

00:22 +2043 ~3 -3: test/general.shard/ios/ios_device_start_nonprebuilt_test.dart: IOSDevice.startApp for CoreDevice in debug mode with flavor succeeds [E]  

Still haven't had a chance to look at this.

@jmagman
Copy link
Member Author

jmagman commented Jul 8, 2024

Still haven't had a chance to look at this, let's see if I get to it before critical triage messages me again!

@jmagman jmagman marked this pull request as ready for review July 17, 2024 18:16
@jmagman jmagman requested review from andrewkolos and LouiseHsu July 17, 2024 18:16
Copy link
Contributor

@LouiseHsu LouiseHsu left a comment

Choose a reason for hiding this comment

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

LGTM!

final FileSystemEntityType type = globals.fs.typeSync(absoluteArchivePath);
globals.printError('Try distributing the app in Xcode:');
if (type == FileSystemEntityType.notFound) {
globals.printError(' open ios/Runner.xcworkspace');
Copy link
Contributor

Choose a reason for hiding this comment

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

minuscule nit: the old error msg is Try distributing the app in Xcode: "open $absoluteArchivePath", but the new one would be Try distributing the app in Xcode: open $absoluteArchivePath
not sure if thats intended?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the quotes in the old one are because it's on the same line, so the quotes delineate the instructions vs the command to run. The new one will print it on a newline with indentation, which matches a few other spots, (though the tool is pretty inconsistent):

globals.printError('Open Xcode to fix the problem:');
globals.printError(' open ios/Runner.xcworkspace');

_logger.printError('Try launching Xcode and selecting "Product > Run" to fix the problem:');
_logger.printError(' open ios/Runner.xcworkspace');

Though, come to think of it, the logger has an indent parameter I can use. I'll update.

@jmagman jmagman added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 22, 2024
@auto-submit auto-submit bot merged commit f33ffc0 into flutter:master Jul 22, 2024
130 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 23, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 23, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 23, 2024
@jmagman jmagman deleted the product-name branch July 23, 2024 17:40
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 27, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 27, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 28, 2024
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…lutter#140242)

1. Instead of getting the `FULL_PRODUCT_NAME` Xcode build setting (`Runner.app`) instead use `PRODUCT_NAME` since most places really want the product name, and the extension stripping wasn't correct when the name contained periods.
2. Don't instruct the user to open the `xcarchive` in Xcode if it doesn't exist.

Fixes flutter#140212
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…lutter#140242)

1. Instead of getting the `FULL_PRODUCT_NAME` Xcode build setting (`Runner.app`) instead use `PRODUCT_NAME` since most places really want the product name, and the extension stripping wasn't correct when the name contained periods.
2. Don't instruct the user to open the `xcarchive` in Xcode if it doesn't exist.

Fixes flutter#140212
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 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.

flutter build ipa fails if product name contains dots
2 participants