Repository: flutter
Issue: Local network permission issue on iOS, crash on launch
Labels: c: crash,platform-ios,tool,e: OS-version specific,P2,team-ios,triaged-ios

@jmagman, following up from https://github.com/flutter/flutter/issues/57225

Steps to reproduce:

1. `flutter create testproject3`
2. `cd testproject3`
3. `flutter run -v > output_1.txt`

The app runs on the iPad, and presents the "testproject3 would like to find and connect to devices on your local network" dialog. The app then crashes (disappears from screen), leaving the dialog still there.

stderr output:

```text
testproject3$ flutter run -v > output_1.txt
[        ] Failed to attach to the observatory.
[   +2 ms] Try accepting the local network permissions popup, or enable "Settings > Privacy > Local Network" for your app.
[        ] For more information, see https://flutter.dev/docs/development/ios-14#debugging-flutter
[        ] Error launching application on Stephen’s iPad.
[   +5 ms]
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:606:7)
           <asynchronous suspension>
           #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:985:18)
           #3      _rootRunUnary (dart:async/zone.dart:1198:47)
           #4      _CustomZone.runUnary (dart:async/zone.dart:1100:19)
           #5      _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
           #6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
           #7      Future._propagateToListeners (dart:async/future_impl.dart:725:32)
           #8      Future._completeWithValue (dart:async/future_impl.dart:529:5)
           #9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
           #10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
           #11     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
           #12     _rootRunUnary (dart:async/zone.dart:1198:47)
           #13     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
           #14     _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
           #15     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
           #16     Future._propagateToListeners (dart:async/future_impl.dart:725:32)
           #17     Future._completeWithValue (dart:async/future_impl.dart:529:5)
           #18     Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
           #19     _rootRun (dart:async/zone.dart:1190:13)
           #20     _CustomZone.run (dart:async/zone.dart:1093:19)
           #21     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
           #22     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
           #23     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
           #24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
           #25     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
           #26     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
```

stdout output attached as `output_1.txt`
[output_1.txt](https://github.com/flutter/flutter/files/5257450/output_1.txt)


Other things happen if I run again, or if I erase the app from the iPad, and run again. But maybe this is enough for now?

Please let me know if I can provide anything else useful.


```text
$ flutter doctor -v
[✓] Flutter (Channel master, 1.22.0-10.0.pre.270, on Mac OS X 10.15.6 19G2021 x86_64, locale en-GB)
    • Flutter version 1.22.0-10.0.pre.270 at /Users/steve/code/flutter
    • Framework revision 36a6ef6486 (10 minutes ago), 2020-09-21 11:02:30 -0700
    • Engine revision 4b8477d115
    • Dart version 2.10.0 (build 2.10.0-142.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/steve/Library/Android/sdk
    • Platform android-29, build-tools 28.0.3
    • 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)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0, Build version 12A7209
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.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.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.14.1


[✓] Connected device (1 available)
    • Stephen’s iPad (mobile) • b0975f3aa3ebe98c71462a866b0356a629fc6aa3 • ios • iOS 14.0
    ! Error: Stephen’s iPad is busy: Copying cache files from device. Xcode will continue when Stephen’s iPad is finished. (code -10)

• No issues found!
```