Comments (3)
Sorry, forgot to mention that this is Android.
from xamarinmediamanager.
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.
Nevermind. I figured out how to fix it. I will create a pull request for the change soon.
from xamarinmediamanager.
Related Issues (20)
- Java.Lang.NoClassDefFoundError com.google.android.exoplayer2.source.ConcatenatingMediaSource HOT 2
- [iOS] sporadically crashes with NSInvalidArgumentException when Play() overload with stopAt argument is called
- PlayingNext() doesnt work on Android and Play works only on iOS
- Java.Lang.NoClassDefFoundError com.google.android.exoplayer2.source.ConcatenatingMediaSource in version 1.2.2 HOT 1
- Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. HOT 1
- Player not loaded, notification not displayed also even with the android 12 patch branch and also with the android 12 2023 branch !!!
- 1.2.2 could crash on earlier Android devices when starting the foreground service. HOT 3
- Ios doesnt play from queue
- Event fired when an element inside of a list of elements sent to play finishes
- Replace conditional compilation with partial classes
- Why version 1.2.2 not support Xamarin?
- MAUI Android audio stops after running in the background for about 15 minutes HOT 6
- Can we change the playback control images of the player using media manager plugin HOT 4
- VideoView Play, Pause and Progressbar controls are not showing on iOS 16+ HOT 1
- M3u8 video playing issue
- Any plans to support WASM / WebAssembly?
- Why no support for `NET7` - and is it planned?
- PositionChanged in milliseconds
- MediaManagerBase.TimerInterval
- MediaManager stops after locking screen HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xamarinmediamanager.