Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS crash: setClip & setLoopMode combination #1105

Open
thesheps opened this issue Oct 26, 2023 · 1 comment
Open

iOS crash: setClip & setLoopMode combination #1105

thesheps opened this issue Oct 26, 2023 · 1 comment
Assignees
Labels
1 backlog bug Something isn't working

Comments

@thesheps
Copy link

thesheps commented Oct 26, 2023

Which API doesn't behave as documented, and how does it misbehave?
In the just_audio package, a combination of calling setClip and setLoopMode results in an unhandled exception:

Unhandled Exception: (9999999) Error in handleMethodCall

If the stop method is called, the entire application then crashes.

Minimal reproduction project
I've updated the minimum example in my fork here

To Reproduce (i.e. user steps, not code)

  1. Run the just_audio example
  2. Press the "loop" button to setLoopMode as loopMode.one
  3. Press the 0-30 secs button
  4. Press the 0-30 secs button again
  5. Press the "Stop" button

Error messages
Step 4 results in the error below. Step 5 causes the app to crash entirely, both on iOS simulator and physical device (but not either Android).

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: (9999999) Error in handleMethodCall
#0      AudioPlayer._load (package:just_audio/just_audio.dart:856:11)
<asynchronous suspension>
#1      AudioPlayer.setClip (package:just_audio/just_audio.dart:870:22)
<asynchronous suspension>
#2      ControlButtons.build.<anonymous closure> (package:just_audio_example/main.dart:216:17)
<asynchronous suspension>

Expected behavior
The playback should continue from Duration.zero as on steps 2 and 3. This minimal example is needlessly setting the SAME clip just to illustrate the bug. In my app, the user is able to set different clips whilst the track plays - it exhibits the same behaviour.

Screenshots
Error message is reported in the debug console, and then the app crashes.

Smartphone (please complete the following information):

  • Device: iPad Mini
  • OS: iOS 17.0.3
  • Simulated iPhone 15 Pro Max

Flutter SDK version

[✓] Flutter (Channel stable, 3.13.6, on macOS 14.1 23B73 darwin-arm64, locale en-GB)
    • Flutter version 3.13.6 on channel stable at /opt/homebrew/Caskroom/flutter/3.7.3/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ead455963c (4 weeks ago), 2023-09-26 18:28:17 -0700
    • Engine revision a794cf2681
    • Dart version 3.1.3
    • DevTools version 2.25.0

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/thesheps/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • ANDROID_HOME = /Users/thesheps/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

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

[✓] Connected device (3 available)
    • iPhone 15 Pro Max (mobile) • 7793AD5C-3063-446B-8276-5604F54C8B4B • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 14.1 23B73 darwin-arm64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 118.0.5993.117

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Additional context
This one's really baking my noodle. I really hope I'm not doing something stupid here!

@thesheps thesheps added 1 backlog bug Something isn't working labels Oct 26, 2023
@bmajkut9
Copy link

I currently have the same problem. Any fixes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants