Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Fix iOS crash when in background for 3 minutes#8930

Merged
cbracken merged 1 commit intoflutter:masterfrom
stupidfive:patch-1
May 13, 2019
Merged

Fix iOS crash when in background for 3 minutes#8930
cbracken merged 1 commit intoflutter:masterfrom
stupidfive:patch-1

Conversation

@stupidfive
Copy link
Contributor

Fix iOS crash when in background for 3 minutes flutter/flutter#32461

As mentioned in Apple Document, the expirationHandler should be used to "to clean up and mark the end of the background task" and "failure to end the task explicitly will result in the termination of the app".

The bug is easily reproducible following the steps in flutter/flutter#32461

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@stupidfive stupidfive changed the title Fix iOS crash when in background for 3 minutes (#32461) Fix iOS crash when in background for 3 minutes May 10, 2019
@stupidfive
Copy link
Contributor Author

Already signed CLA. Do I have to resubmit pull request?

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

LGTM stamp from a Japanese personal seal

@cbracken cbracken merged commit 47fd66c into flutter:master May 13, 2019
@cbracken
Copy link
Member

Thanks for the fix! Merged!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 13, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request May 13, 2019
flutter/engine@f4d23ef...904cfc4

git log f4d23ef..904cfc4 --no-merges --oneline
904cfc4 Add @UiThread to MethodChannel and related classes/calls (#32642). (flutter/engine#8947)
c9406d4 Roll src/third_party/skia d696f8e6bca3..0221e8b22687 (5 commits) (flutter/engine#8948)
1b649a5 update docs (flutter/engine#8928)
47fd66c Terminate debug background task on expiry (flutter/engine#8930)
14c82d9 Only cache required frames (flutter/engine#8837)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
huqiuser pushed a commit to huqiuser/engine that referenced this pull request Jun 12, 2019
When backgrounding an app in debug mode, we make a request for
additional background time for the app with a background task. This
prevents us from losing the devfs session used for hot reload. In the
case where the app is backgrounded beyond the additional time provided
by iOS, it's required that we end the background task or the app will
be terminated by the OS.

We previously ended the background task only on foregrounding, but
failed to do so on expiry of the task.
@MazEbeid
Copy link

MazEbeid commented Jul 20, 2019

Hi .. I am new to all of this and I am having the same problem .. my app crashes once it's in the background for some time. What does it mean when you mark the issue fixed? Do I need to update to a different flutter version where is the fix exactly?
Thanks

Please see the below log after the app was terminated
[+1673 ms] Service protocol connection closed. [ ] Lost connection to device. [ +2 ms] DevFS: Deleting filesystem on the device (file:///private/var/mobile/Containers/Data/Application/A4613311-537B-48FE-930C- EDCD59B696A5/tmp/seesometerStPr8t/seesometer/) [ ] Sending to VM service: _deleteDevFS({fsName: seesometer}) [ +256 ms] Ignored error while cleaning up DevFS: TimeoutException after 0:00:00.250000: Future not completed [ +3 ms] "flutter run" took 228,531ms. [ ] "flutter run" took 228,531ms.

Flutter doctor output:

`[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale
en-GB)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
[✓] Android Studio (version 3.4)
[✓] IntelliJ IDEA Community Edition (version 2019.1.3)
[!] VS Code (version 1.36.1)
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (1 available)`

@njovy
Copy link

njovy commented Nov 26, 2019

I thought I did something wrong in my code but this only happens on iOS.
I am still seeing this issue with the latest stable

[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.14.4 18E226, locale en-KR)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.3)
[✓] Connected device (2 available)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants