question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scan causes crash on Android detected by AppCenter

See original GitHub issue

Hi,

I post here because I received on AppCenter of my application a crash error from Plugin.BLE, I don’t know how and why this error is triggered but I wish with the Xamarin exception stack thah you can help me

Steps to reproduce

Nothing sorry

Crashlog

Xamarin Exception Stack:
System.ArgumentException: length
  at System.Array.Copy (System.Array sourceArray, System.Int32 sourceIndex, System.Array destinationArray, System.Int32 destinationIndex, System.Int32 length) [0x000b4] in <5a88e350e0674dd7b8ddba06471cdfe2>:0
  at Plugin.BLE.Android.Device.ParseScanRecord (System.Byte[] scanRecord) [0x00066] in <17887b5227df4ea9ab9b317d496489c6>:0
  at Plugin.BLE.Android.Device..ctor (Plugin.BLE.Android.Adapter adapter, Android.Bluetooth.BluetoothDevice nativeDevice, Android.Bluetooth.BluetoothGatt gatt, System.Int32 rssi, System.Byte[] advertisementData) [0x00017] in <17887b5227df4ea9ab9b317d496489c6>:0
  at Plugin.BLE.Android.Adapter+Api21BleScanCallback.OnScanResult (Android.Bluetooth.LE.ScanCallbackType callbackType, Android.Bluetooth.LE.ScanResult result) [0x00026] in <17887b5227df4ea9ab9b317d496489c6>:0
  at Android.Bluetooth.LE.ScanCallback.n_OnScanResult_ILandroid_bluetooth_le_ScanResult_ (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 native_callbackType, System.IntPtr native_result) [0x00011] in <950ad56dbf9942d1a0c82aaea5a2cf2a>:0
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.49(intptr,intptr,int,intptr)

Configuration

Version of the Plugin: 2.1.1 Android: 9 Android Build: 50.2.A.3.77 Manufacturer: Sony Model: Xperia XA2 (H3113)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
januswcommented, Aug 4, 2023

This should be fixed via #719. Exceptions in ParseScanRecord are being caught now and incorrect records are disposed (with some debug output written to the log).

1reaction
busec0commented, Jun 5, 2023

I’m getting the same thing, but this is a sporadic thing, cannot constantly reproduce.

1. Verify that the length byte is correct (before copying data out of the byte array) and simply dispose malformed advertisements.

Sounds perfect for now, adding a trace with the hex dump if it fails.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Center Crashes for Android - Visual Studio
App Center Crashes will automatically generate a crash log every time your app crashes. The log is first written to the device's storage...
Read more >
Detect and diagnose crashes
Detect and diagnose crashes ... An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app...
Read more >
My Android app is crashing and AppCenter gives no details
Hi, I am testing my app on Debug mode and it's working perfectly and then when I install the apk (from Release mode)...
Read more >
App crashes after clicking scan button for the first time but ...
I'm trying to create an indoor location services app in android studio.There is a scan button which start the discovery of BLE devices....
Read more >
App Crash Details Without Hassle with App Center ... - YouTube
Asking your user how a crash happened isn't usually very effective. Lucky for us there is now App Center Diagnostics! With this tool...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found