-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add observatory Bonjour service to built iOS Info.plist bundle #65138
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
Conversation
| 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 |
There was a problem hiding this comment.
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.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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...

Also, a screenshot with those build phases expanded.
There was a problem hiding this comment.
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:
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
gaaclarke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
flutter#65138)" (flutter#65141) This reverts commit 5e0aa8b.


Reland #64988, which failed post-submit due to #65124.
Description
Add
NSBonjourServices_dartobservatory._tcpandNSLocalNetworkUsageDescriptionto debug and profileInfo.plistin 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.
NSLocalNetworkUsageDescriptionis underneath: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_testto validate Release does not have the keys, but Debug does.Move
xcode_backend_teststo 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
///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change