Skip to content

Conversation

tauu
Copy link
Contributor

@tauu tauu commented Apr 16, 2020

Description

As reported by @Henrik-glt in #51126 , when running a flutter app with a watchOS companion app on a physical iOS device using the flutter run command, the build currently breaks, although it works for simulated devices. The reason for this behaviour is, that when building for a physical device, the following parameters are set for xcodebuild:

ONLY_ACTIVE_ARCH=YES
ARCHS=$activeArchName //$activeArchName is the architecture of the iOS device.

Consequently xcodebuild will attempt to build the watchOS companion for the architecture of the iOS device, which is not possible. This PR fixes the issue by not setting the ARCHS parameter if a watchOS companion app is detected in the ios project.

Upon further investigation it seems that using ONLY_ACTIVE_ARCH=YES in combination with ARCHS is not an intended use case. See also the xcode build system guide. So I would propose to drop setting ARCHS for the build path having ONLY_ACTIVE_ARCH=YES. I performed just a few tests, but so far setting ONLY_ACTIVE_ARCH=YES was sufficient to limit the build to the architecture of the target device. Because more intensive tests might be required for this change, it could also be made in a separate PR.

Tests

I added the following tests:

  • none

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read [Handling breaking changes].

  • No, no existing tests failed, so this is not a breaking change.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 16, 2020
@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

LGTM

@jmagman jmagman merged commit f1d522d into flutter:master Apr 16, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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