ServiceBase.GetCharacteristicsAsync() throws ArgumentException: length
See original GitHub issueThis error is happening extremely often and only on Android.
It’s easy workaround, just adding a try catch and calling the method again fixes it.
Steps to reproduce
- Request characteristics
Expected behavior
Characteristics should be loaded.
Actual behavior
Method throws an exception.
Crashlog
ServiceBase.GetCharacteristicsAsync () System.ArgumentException: length
System
Array.Copy (System.Array sourceArray, System.Int32 sourceIndex, System.Array destinationArray, System.Int32 destinationIndex, System.Int32 length)
System.Collections.Generic
List`1[T].CopyTo (T[] array, System.Int32 arrayIndex)
System.Collections.Generic.List`1[T]
System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x0003b] in <ca00b961ae9e43f0bc6166bec1195ff4>:0
System.Linq
Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source)
Plugin.BLE.Abstractions
ServiceBase.GetCharacteristicsAsync ()
Plugin.BLE.Abstractions
ServiceBase.GetCharacteristicAsync (System.Guid id)
Configuration
Version of the Plugin: 2.1.3
Platform:
- Android 10
- Android 11
- Android 12
- Android 13
Device:
- Galaxy A52s 5G
- Galaxy S21 5G
- P30 Pro
- Galaxy A51
- HUAWEI P30 lite
- Galaxy S9
- Galaxy S10
- Galaxy S20 FE
- Galaxy S20 FE 5G
- Galaxy A50
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
xamarin-bluetooth-le
Hi there,. Question: I've got a "vanilla"-App using this plugin. It works quite well, however, the amount of time of connections made by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think it’s a duplicate, it might be worth a mention, but the stack traces and when it occurs are different.
No clear reproducer made yet. Collecting information about this is slow as it’s again one of those bugs that don’t happen on the dev side.
Looks like a duplicate of https://github.com/dotnet-bluetooth-le/dotnet-bluetooth-le/issues/567