Baseflow / Baseflow/XamarinMediaManager
ArgumentOutOfRangeException @ Android
- Dominant language
- C#
- Stars
- 763
- Forks
- 299
- PR merge metrics
- No merged PRs in 30d
Description
I am randomly encountering the following crash on Android
**Any idea how can I can avoid that crash?**
Xamarin Exception Stack:
```
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) <0x78bd0e0e40 + 0x0007b> in <3856ff9d2a624b83b52be2f7528d1ab1>:0
at System.Collections.ObjectModel.Collection`1[T].get_Item (System.Int32 index) <0x78bd0d2fc0 + 0x00063> in <3856ff9d2a624b83b52be2f7528d1ab1>:0
at MediaManager.Queue.MediaQueue.get_Item (System.Int32 index) [0x00006] in :0
at System.Linq.Enumerable.ElementAtOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Int32 index) <0x78b96a6160 + 0x00117> in :0
at MediaManager.Platforms.Android.Media.MediaDescriptionAdapter.GetCurrentContentTextFormatted (Com.Google.Android.Exoplayer2.IPlayer player) [0x00011] in :0
at Com.Google.Android.Exoplayer2.UI.PlayerNotificationManager+IMediaDescriptionAdapterInvoker.n_GetCurrentContentText_Lcom_google_android_exoplayer2_Player_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_p0) [0x00011] in <2a69df5e1b684529aaf6028d6e459c77>:0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.89(intptr,intptr,intptr)
```
Contributor guide
Research direction
Start at MediaManager.Queue.MediaQueue.get_Item and the Android entry point MediaDescriptionAdapter.GetCurrentContentTextFormatted named in the stack trace. Trace how the player callback obtains its queue index and reproduce the reported Android crash. Done means the callback no longer throws ArgumentOutOfRangeException for the reported case, with coverage for the failing queue state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, csharp
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100