Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Sep 3, 2020

Reland #64988, which failed post-submit due to #65124.

Description

Add NSBonjourServices _dartobservatory._tcp and NSLocalNetworkUsageDescription to debug and profile Info.plist in the produced, bundled .app (not the user-facing Info.plist created in the template and included in Xcode).

This prompts the "Your app would like to find and connect to devices on your local network" permission popup, which is required to unblock the observatory publisher on iOS 14.

NSLocalNetworkUsageDescription is underneath:

Screen Shot 2020-09-02 at 5 36 59 PM

Note: this does not add the keys for add-to-app host apps, so they still have the issue of blocking the observatory publisher.

Related Issues

Fixes #60634
Fixes #35707.
Related to conversation at #63893, but that is for add-to-app.

Tests

Updated ios_content_validation_test to validate Release does not have the keys, but Debug does.
Move xcode_backend_tests to the command shard, add new behavior tests.

Kudos

Thanks to @gaaclarke for suggesting to just add the keys in the generated bundle Info.plist, and not the one that's created in the template. That avoided a huge migration headache.

Checklist

  • 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

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@jmagman jmagman added platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management labels Sep 3, 2020
@jmagman jmagman requested review from dnfield and xster September 3, 2020 00:14
@jmagman jmagman self-assigned this Sep 3, 2020
@flutter-dashboard flutter-dashboard bot added c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Sep 3, 2020
Comment on lines +336 to +339
if [[ ! -f "${built_products_plist}" ]]; then
EchoError "error: ${INFOPLIST_PATH} does not exist. The Flutter \"Thin Binary\" build phase must run after \"Copy Bundle Resources\"."
exit -1
fi
Copy link
Member Author

Choose a reason for hiding this comment

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

This check is new and was not in #64988. If the user rearranged their build scripts manually, error and tell them how to fix it.
Screen Shot 2020-09-02 at 5 16 38 PM

Copy link

Choose a reason for hiding this comment

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

Well I get this error but the build script "Thin Binary" is after "Copy Bundle Resources"
Bildschirmfoto 2020-09-09 um 11 29 50

Copy link
Member Author

Choose a reason for hiding this comment

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

@bennibau can you file a new issue and @ mention me? I want to see what's going on in your case.

Please include the output of flutter doctor -v and the full exported Xcode run report.
View > Navigator > Reports > Export...
Screen Shot 2020-09-10 at 1 41 57 PM

Also, a screenshot with those build phases expanded.

Choose a reason for hiding this comment

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

I'm also hitting this error with this build script:

Screen Shot 2020-10-04 at 4 42 50 PM

flutter doctor -v:

[✓] Flutter (Channel master, 1.23.0-8.0.pre.131, on Mac OS X 10.15.6 19G2021 x86_64, locale en-US)
• Flutter version 1.23.0-8.0.pre.131 at /Users/samparks/dev/sdks/flutter
• Framework revision 8485580 (3 hours ago), 2020-10-04 14:47:02 -0400
• Engine revision a8d7d97
• Dart version 2.11.0 (build 2.11.0-185.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/samparks/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0.1, Build version 12A7300
• CocoaPods version 1.9.3

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 48.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.49.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.15.0

[✓] Connected device (3 available)
• iPhone (mobile) • 00008030-000608880E9B802E • ios • iOS 13.7
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 85.0.4183.121

• No issues found!

infoPlist = buildDirectory.childFile('Info.plist');
});

test('fails when the Info.plist is missing', () async {
Copy link
Member Author

Choose a reason for hiding this comment

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

This test is new.

expect(result.exitCode, isNot(0));
}

test('Xcode backend fails with no arguments', () async {
Copy link
Member Author

@jmagman jmagman Sep 3, 2020

Choose a reason for hiding this comment

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

This is new and tests #65124

Copy link
Member

@gaaclarke gaaclarke 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 5e0aa8b into flutter:master Sep 3, 2020
@jmagman jmagman deleted the bonjour-service branch September 3, 2020 00:57
jmagman added a commit that referenced this pull request Sep 3, 2020
jmagman added a commit that referenced this pull request Sep 3, 2020
jmagman added a commit that referenced this pull request Sep 3, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
@jmagman jmagman mentioned this pull request Sep 15, 2020
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

5 participants