Skip to content

backgroundTaskEntrypoint cached with hot reload / hot restart #210

@scullabyte

Description

@scullabyte

Describe the bug
A clear and concise description of what the bug is.
I'll edit something inside of the backgroundTaskEntrypoint function. Hot reload. It will then use the previous function. If i delete the backgroundTaskEntrypoint function it will still run.
.

To Reproduce
Steps to reproduce the behavior:

  1. start with backgroundTaskEntrypoint: myFunc where I print something and run AudioServiceBackground.

  2. rename myFunc to myFunc2 and change the AudioService.start function to backgroundTaskEntrypoint: myFunc2 --> nothing will log.

  3. Change it back to backgroundTaskEntrypoint: myFunc --> it will work, even if myFunc doesn't exist anymore.

Expected behavior
On changing anything inside of the backgroundTaskEntrypoint function, I hot reload or hot restart and I can see the changes.

Runtime Environment (please complete the following information if relevant):

  • Device: iPhone10
  • iOS version: 13.3

Flutter SDK version

[✓] Flutter (Channel master, v1.15.22-pre.12, on Mac OS X 10.15.3 19D76, locale en)
    • Flutter version 1.15.22-pre.12 at /Users/admin/flutter
    • Framework revision 66f6ca7daa (3 hours ago), 2020-03-13 15:16:01 -0400
    • Engine revision 57e69fe176
    • Dart version 2.8.0 (build 2.8.0-dev.14.0 a303769fad)


[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/admin/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.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_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.9.1

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 43.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

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

[✓] Connected device (2 available)
    • Kevin’s iPhone    • 16e0be0d98a45594d66fce5bc03767078a0adaf9 • ios • iOS 13.3.1
    • iPhone 11 Pro Max • A2A38E8B-0E8F-4D74-B2AD-8F4FCAB619F1     • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)

• No issues found!```

**Additional context**
There HAS to be a better way to debug this.. right? Compiling my entire application always takes 3-7 minutes, so doing that every time I want to check my code would be a nightmare. I've done a lot of creative things to try to reset the cache without recompiling and everything refreshes except for the 'audio_service' stuff.

I do get this error message after the first hot restart, and it doesn't happen when I comment out audio_service code:
`Hot reload received invalid response: {type: Sentinel, kind: Collected, valueAsString: <collected>}`

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions