You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use serviceData in AdvertiseData, for example: serviceData: [7,8,9,10]
I get the following error at the beginning of a advertisment function:
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): Failed to handle method call
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): java.lang.ClassCastException: java.util.ArrayList cannot be cast to byte[]
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at dev.steenbakker.flutter_ble_peripheral.FlutterBlePeripheralPlugin.startPeripheral(FlutterBlePeripheralPlugin.kt:167)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at dev.steenbakker.flutter_ble_peripheral.FlutterBlePeripheralPlugin.onMethodCall(FlutterBlePeripheralPlugin.kt:123)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at android.os.Handler.handleCallback(Handler.java:938)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at android.os.Looper.loopOnce(Looper.java:226)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at android.os.Looper.loop(Looper.java:313)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at android.app.ActivityThread.main(ActivityThread.java:8751)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/MethodChannel#dev.steenbakker.flutter_ble_peripheral/ble_state( 8553): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
The text was updated successfully, but these errors were encountered:
I realized that when you set serviceData: Uint8List.fromList([0x41, 0x42, 0x43, 0x44]) and includeDeviceName: false it works, otherwise you get PlatformException (PlatformException(1, ADVERTISE_FAILED_DATA_TOO_LARGE, startAdvertising, null)). I guess it could be related to device name being too long or something. Is there a work around for this to keep the device name short since on android we cannot set the localName?
When trying to use serviceData in AdvertiseData, for example:
serviceData: [7,8,9,10]
I get the following error at the beginning of a advertisment function:
The text was updated successfully, but these errors were encountered: