question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] Hot Restart

See original GitHub issue

The app uses FlutterSoundPlayer singleton to play audio. When it is hot restart app, the program will crash.

when call await playerModule.openAudioSession() in iOS, program will crash。 but It’s good on Android

FlutterSoundPlayer playerModule = FlutterSoundPlayer();
  bool _isMute = false;
  bool _isPlayInited = false;

  static SoundManager _getInstance() {
    if (_instance == null) {
      _instance = new SoundManager._internal();
    }
    return _instance;
  }

  SoundManager._internal() {
    initAudioPlay();
  }

  Future<void> initAudioPlay() async {
    try {
      await playerModule.openAudioSession(
          focus: AudioFocus.requestFocusAndStopOthers,
          category: SessionCategory.playAndRecord);
      await playerModule.setSubscriptionDuration(Duration(milliseconds: 100));
      _isPlayInited = true;
      return Future.value(true);
    } catch(e){
      return Future.value(false);
    }
  }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

3reactions
Larpouxcommented, Dec 27, 2020

Several Flutter Sound users complained about that.

There is really something wrong in Flutter Sound. @bsutton investigated this and found the solution but he does not want to work anymore with us 👎 .

Registered in the Flutter Sound Project

0reactions
Larpouxcommented, Feb 11, 2021

Fixed in Flutter Sound release 7.6.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hot Reload Stopped Working after Hot Restart #3511 - GitHub
Describe the bug. Flutter Hot Reload function has stopped working in the lastest Dart Code v3. · Steps to reproduce the behavior: ·...
Read more >
Hot reload - Flutter documentation
Flutter's hot reload feature helps you quickly and easily experiment, build UIs, add features, and fix bugs. Hot reload works by injecting updated...
Read more >
Difference Between Hot Reload and Hot Restart in Flutter
Hot Reload allows us to see the reflected change after bug fixes, building User interfaces and even adding certain features to the app...
Read more >
Hot Reload of .NET 6 & Visual Studio 2022 in (buggy) action ...
NET Jumpstart Course: https://www.udemy.com/course/net-core-31-web-api-entity-framework-core-jumpstart/?referralCode=CA390CA392FF8B003518  ...
Read more >
Hot reload bug? : r/sveltejs - Reddit
I'm having an issue with the hot reload feature. I used svelte-add to load tailwinds. I have a couple modules in /src/lib that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found