XamarinMediaManager
XamarinMediaManager copied to clipboard
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
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
Collection1[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.