Giter Site home page Giter Site logo

Comments (3)

jmartine2 avatar jmartine2 commented on May 12, 2024

Sorry, forgot to mention that this is Android.

from xamarinmediamanager.

jmartine2 avatar jmartine2 commented on May 12, 2024

This issue is still causing me problems. The exception happens in the following circumstance: If I'm playing music through a Bluetooth speaker, then turn off the speaker while the music is playing, the music switches to playing through the device's built-in speaker for a few seconds, then it crashes.

Just before the crash AudioPlayerBroadcastReceiver.OnReceieve() is called, and the call to context.StartService(stopIntent); causes the exception. I have included the stack trace below.

Has anyone else run into this issue?

Any idea of how to fix it?

java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.xamarin.action.STOP }
android.app.ContextImpl.validateServiceIntent()ContextImpl.java:2052
android.app.ContextImpl.startServiceCommon()ContextImpl.java:2090
android.app.ContextImpl.startService()ContextImpl.java:2065
android.content.ContextWrapper.startService()ContextWrapper.java:533
md5cb45d68da0a4a063a9a2b86b6adab38d.AudioPlayerBroadcastReceiver.n_onReceive(Native Method)
md5cb45d68da0a4a063a9a2b86b6adab38d.AudioPlayerBroadcastReceiver.onReceive()AudioPlayerBroadcastReceiver.java:29
android.app.ActivityThread.handleReceiver()ActivityThread.java:3002
android.app.ActivityThread.access$1800()ActivityThread.java:177
android.app.ActivityThread$H.handleMessage()ActivityThread.java:1526
android.os.Handler.dispatchMessage()Handler.java:102
android.os.Looper.loop()Looper.java:145
android.app.ActivityThread.main()ActivityThread.java:5951
java.lang.reflect.Method.invoke(Native Method)
java.lang.reflect.Method.invoke()Method.java:372
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:1399
com.android.internal.os.ZygoteInit.main()ZygoteInit.java:1194
Xamarin caused by: Java.Lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.xamarin.action.STOP }
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()exceptionservicescommon.cs:143
Java.Interop.JniEnvironment.InstanceMethods.CallObjectMethod(JniObjectReference instance, JniMethodInfo method, JniArgumentValue* args)JniEnvironment.g.cs:11283
Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualObjectMethod(string encodedMember, IJavaPeerable self, JniArgumentValue* parameters)JniPeerMembers.JniInstanceMethods_Invoke.cs:350
Android.Content.ContextWrapper.StartService(Intent service)Android.Content.ContextWrapper.cs:3281
Plugin.MediaManager.AudioPlayerBroadcastReceiver.OnReceive(Context context, Intent intent)
Android.Content.BroadcastReceiver.n_OnReceive_Landroid_content_Context_Landroid_content_Intent_(IntPtr jnienv, IntPtr native__this, IntPtr native_context, IntPtr native_intent)Android.Content.BroadcastReceiver.cs:393
at (wrapper dynamic-method) System.Object:c3c05af8-86fe-4072-a8b3-4ecfaa76f1eb (intptr,intptr,intptr,intptr)
--- End of managed Java.Lang.IllegalArgumentException stack trace ---
java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.xamarin.action.STOP }
android.app.ContextImpl.validateServiceIntent()ContextImpl.java:2052
android.app.ContextImpl.startServiceCommon()ContextImpl.java:2090
android.app.ContextImpl.startService()ContextImpl.java:2065
android.content.ContextWrapper.startService()ContextWrapper.java:533
md5cb45d68da0a4a063a9a2b86b6adab38d.AudioPlayerBroadcastReceiver.n_onReceive(Native Method)
md5cb45d68da0a4a063a9a2b86b6adab38d.AudioPlayerBroadcastReceiver.onReceive()AudioPlayerBroadcastReceiver.java:29
android.app.ActivityThread.handleReceiver()ActivityThread.java:3002
android.app.ActivityThread.access$1800()ActivityThread.java:177
android.app.ActivityThread$H.handleMessage()ActivityThread.java:1526
android.os.Handler.dispatchMessage()Handler.java:102
android.os.Looper.loop()Looper.java:145
android.app.ActivityThread.main()ActivityThread.java:5951
java.lang.reflect.Method.invoke(Native Method)
java.lang.reflect.Method.invoke()Method.java:372
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:1399
com.android.internal.os.ZygoteInit.main()ZygoteInit.java:1194

from xamarinmediamanager.

jmartine2 avatar jmartine2 commented on May 12, 2024

Nevermind. I figured out how to fix it. I will create a pull request for the change soon.

from xamarinmediamanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.