Baseflow / Baseflow/XamarinMediaManager
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
- Dominant language
- C#
- Stars
- 763
- Forks
- 299
- PR merge metrics
- No merged PRs in 30d
Description
My application crashed with this exception on my Android phone:
`MediaQueue.get_Item (System.Int32 index)
Z:\Documents\OpenSource\XamarinMediaManager\MediaManager\Queue\MediaQueue.cs, line 137
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index`
Stack traces:
`List`1[T].get_Item (System.Int32 index) /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:161
Collection`1[T].get_Item (System.Int32 index) /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/Common/src/CoreLib/System/Collections/ObjectModel/Collection.cs:46
MediaQueue.get_Item (System.Int32 index) Z:\Documents\OpenSource\XamarinMediaManager\MediaManager\Queue\MediaQueue.cs:137
Enumerable.ElementAtOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Int32 index) /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.Linq/src/System/Linq/ElementAt.cs:71
MediaDescriptionAdapter.GetCurrentContentTitleFormatted (Com.Google.Android.Exoplayer2.IPlayer player) Z:\Documents\OpenSource\XamarinMediaManager\MediaManager\Platforms\Android\Media\MediaDescriptionAdapter.cs:66
PlayerNotificationManager+IMediaDescriptionAdapterInvoker.n_GetCurrentContentTitle_Lcom_google_android_exoplayer2_Player_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_p0) C:\Users\mhvdi\Documents\OpenSource\ExoPlayerXamarin\ExoPlayer.UI\obj\Release\monoandroid10.0\generated\src\Com.Google.Android.Exoplayer2.UI.PlayerNotificationManager.cs:440
(wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.65(intptr,intptr,intptr)`
I use Plugin.MediaManager nuget package 1.1.0 on Android and Visual Studio for Mac.
Contributor guide
Research direction
Start with MediaManager/Platforms/Android/Media/MediaDescriptionAdapter.cs at line 66 and MediaManager/Queue/MediaQueue.cs at line 137. Trace how the current player index reaches the queue access and reproduce the crash using the Android scenario and Plugin.MediaManager 1.1.0. Done means the reported out-of-range exception no longer occurs in that path.
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
- 25/100