ryanheise / audio_service

Flutter plugin to play audio in the background while the screen is off.
787 stars 463 forks source link

Unable to bind to AudioService #1071

Closed AyhamHammad202 closed 2 months ago

AyhamHammad202 commented 2 months ago

Minimal reproduction project

https://github.com/AyhamHammad202/islamic_app/tree/main

Build command

flutter run

Build error

W/System.err( 6415): java.lang.IllegalStateException: Unable to bind to AudioService. Please ensure you have declared a <service> element as described in the README.
W/System.err( 6415):    at com.ryanheise.audioservice.AudioServicePlugin$ClientInterface.onMethodCall(AudioServicePlugin.java:450)
W/System.err( 6415):    at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
W/System.err( 6415):    at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
W/System.err( 6415):    at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
W/System.err( 6415):    at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
W/System.err( 6415):    at android.os.Handler.handleCallback(Handler.java:873)
W/System.err( 6415):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/System.err( 6415):    at android.os.Looper.loop(Looper.java:193)
W/System.err( 6415):    at android.app.ActivityThread.main(ActivityThread.java:6825)
W/System.err( 6415):    at java.lang.reflect.Method.invoke(Native Method)
W/System.err( 6415):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
W/System.err( 6415):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)

Output of flutter doctor

[√] Flutter (Channel stable, 3.19.4, on Microsoft Windows [Version 10.0.19045.4291], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2022.1)
[√] VS Code (version 1.89.1)
[√] Connected device (4 available)
[√] Network resources
ryanheise commented 2 months ago

That is not a build error, that is a runtime error. If your bug report looks like this, it is because you selected the option where the bug happens at "compile time" rather than where the bug happens at "runtime".

Finally, I would point out that your so-called "minimal" reproduction project looks far from minimal. It's a huge example, in fact it looks more like a full entire app rather than a minimal reproduction project. Don't expect me to spend the time studying an example as big as this. What you should do (see the "contributing guidelines" linked at the bottom of this page, is to fork this repository and make minimal changes in order to demonstrate the bug. "Minimal" means that if you change 3 lines where changing 1 line will do, prefer to change just 1 line instead. I will examine the diff to see what you changed.

(Closing this as an invalid bug report. Please submit a new one as per the given instructions.)

github-actions[bot] commented 1 month ago

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.