Plugin: Android native function not called

Hello everyone,

I’m developing a plugin to handle bluetooth classic communication; everything seems to work fine, except for the write function. It looks like the method is not implemented, although the function is written both in the definitions.ts file and in the Java plugin file file

    public void write(PluginCall call) {
        call.unimplemented("not yet working");

If I execute the app on an android device and try to call the write function, nothing happens: looking at the logs yelds this:

2023-07-25 09:29:54.887  8624-8624  AutofillManager         io.ionic.starter                     V  requestHideFillUi(null): anchor = null
2023-07-25 09:29:54.976  8624-8624  Capacitor/Plugin        io.ionic.starter                     V  To native (Capacitor plugin): callbackId: 131962550, pluginId: Bluetooth, methodName: write
2023-07-25 09:29:54.976  8624-8624  Capacitor               io.ionic.starter                     V  callback: 131962550, pluginId: Bluetooth, methodName: write, methodData: {"message":"hello world"}

The definition.ts file looks like this:

  init(): Promise<void>;
  checkPermissions(): Promise<PermissionStatus>;
  requestPermissions(): Promise<PermissionStatus>;
  startListening(): Promise<boolean>;
  stopListening(): Promise<boolean>;
  write(data: {message: string}): Promise<boolean>;

All other methods work fine, but “write” does not. Anyone ever had this kind of problem?

Edit: already tried renaming the function, link/unlinking; nothing works

Edit2: started using breakpoints on the Bridge files for Capacitor. All methods are being registered with the plugin, but the only that is not getting invoked is write .

@matfire Just found your StackOverflow question and added a comment, then discovered that you posted here too. Do you have a Github repo of this plugin that I can test and replicate the issue?