Repository: flutter
Issue: HttpServer crashes on iOS app in TestFlight when coming back from standby
Labels: c: crash,platform-ios,engine,dependency: dart,a: production,P2,dependency: dart:io,team-ios,triaged-ios

OK, this might be a tough one to debug, but I experience the following with the app I am working on at the moment and I can reproduce it locally. No clue how to create some logs for this one though. Here's what happens:

The app uses an `HttpServer` to serve local assets to a `webview_flutter`. All works great in the Android app running in simulator or on device either from a local machine or loaded from the Play Store. 

The iOS version runs fine locally in a simulator or on a real device. But when I load the app through TestFlight onto a real device, the following happens:

1. App starts normally, internal webserver starts and serves a file from assets.
2. The user pushes the home button to send the app to the background.
3. The user pushes the power off button of the device briefly to bring it into standby.
4. The user pushed the power button again briefly to turn the device back on.
5. The user tries to load the same file, but this time the internal webserver does not respond anymore until the app is killed and restarted.

My guess is that there is problem with the webserver somehow crashing on iOS when the app wakes up again (resumes running from standby).

```
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.7 19H2, locale de-PT)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.49.3)
[✓] Connected device (2 available)
    ! Error: Georgs iPhone 6s Plus is busy: Copying cache files from device.
      Xcode will continue when Georgs iPhone 6s Plus is finished. (code -10)

• No issues found!
georg@MM20 font_awesome_flutter-master % flutter doctor -v
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.7 19H2, locale de-PT)
    • Flutter version 1.22.0 at /Users/georg/bin/flutter
    • Framework revision d408d302e2 (9 days ago), 2020-09-29 11:49:17 -0700
    • Engine revision 5babba6c4d
    • Dart version 2.10.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/georg/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

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • 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 (2 available)
    • Nokia 5 3 (mobile)             • N0AA003628K71000589
      • android-arm64 • Android 10 (API 29)
    • Georgs iPhone 6s Plus (mobile) • 677d8be9c78d54dbce7fc7f97a46c0f81f31322c
      • ios           • iOS 14.0.1
```