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

AudioServiceBackground.setMediaItem was called on null #175

Closed
riskikukuh opened this issue Feb 12, 2020 · 4 comments
Closed

AudioServiceBackground.setMediaItem was called on null #175

riskikukuh opened this issue Feb 12, 2020 · 4 comments

Comments

@riskikukuh
Copy link

Describe the bug
_backgroundChannel is null just in function setMediaItem, other function work well. File BackgroundAudioTask in music_player/model/musicPlayerModel.dart.

Screenshots
No Screenshots for this issue.

Error messages

E/flutter ( 2489): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method 'invokeMethod' was called on null.
E/flutter ( 2489): Receiver: null
E/flutter ( 2489): Tried calling: invokeMethod<dynamic>("setMediaItem", _LinkedHashMap len:12)
E/flutter ( 2489): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
E/flutter ( 2489): #1      AudioServiceBackground.setMediaItem (package:audio_service/audio_service.dart:888:30)
E/flutter ( 2489): #2      MusicPlayer._skip (package:music_player/model/musicPlayerModel.dart:314:28)
E/flutter ( 2489): #3      MusicPlayer.play (package:music_player/model/musicPlayerModel.dart:129:5)
E/flutter ( 2489): <asynchronous suspension>
E/flutter ( 2489): #4      _HomepageState.build.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:music_player/homePage.dart:134:26)
E/flutter ( 2489): #5      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14)
E/flutter ( 2489): #6      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:789:36)
E/flutter ( 2489): #7      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter ( 2489): #8      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11)
E/flutter ( 2489): #9      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5)
E/flutter ( 2489): #10     BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:236:7)
E/flutter ( 2489): #11     GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter ( 2489): #12     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20)
E/flutter ( 2489): #13     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter ( 2489): #14     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter ( 2489): #15     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter ( 2489): #16     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter ( 2489): #17     _rootRunUnary (dart:async/zone.dart:1138:13)
E/flutter ( 2489): #18     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter ( 2489): #19     _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
E/flutter ( 2489): #20     _invoke1 (dart:ui/hooks.dart:273:10)
E/flutter ( 2489): #21     _dispatchPointerDataPacket (dart:ui/hooks.dart:182:5)
E/flutter ( 2489): 

Minimal reproduction project
This my project https://github.com/riskikukuh/music_player

To Reproduce
Steps to reproduce the behavior:

  1. I create file for handle state, i using provider. I make BackgroundAudioTask code and ChangeNotifier in one file, the name class is MusicPlayer.

Expected behavior
I expect _backgroundChannel was null because i merge 2 class to 1 class.

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

  • Device: Xiaomi Redmi 3s CUSTOM ROM
  • Android version: 9
  • iOS version: ~

Flutter SDK version

[✓] Flutter (Channel unknown, v1.12.13+hotfix.7, on Linux, locale
    en_US.UTF-8)
 
[✓] Android toolchain - develop for Android devices (Android SDK 
    version 29.0.2)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Community Edition (version 2019.2)
[✓] VS Code (version 1.41.1)
[✓] Connected device (1 available)

• No issues found!
@pro100svitlo
Copy link

pro100svitlo commented Apr 13, 2020

Hello!
Did you figure out what was the reason?

@scullabyte
Copy link

???

@ryanheise
Copy link
Owner

This issue was closed before I had a chance to look at it and the reproduction project is no longer available.

If anyone else is experiencing a genuine bug here, please consider opening a new bug report, and provide a new minimal reproduction project along with it.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with audio_service.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants