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
I'm running into issues with my svelte-native application when I try to instantiate the Bluetooth from the plugin inside my Worker.
I've created a demo project so I could more easily reproduce the issue (https://github.com/AdrianoOP/bluetooth-worker-test). I can make it work perfectly in the main thread, but in the Worker I an error when trying to instantiate the Bluetooth class. Before trying to instantiate the class I'm making sure that permissions have been granted.
Situation happens both with my simulator (Android 13) and cellphone (Android 11)
const communicator = new Bluetooth(); // throws the error below
Error: Trying to link invalid 'this' to a Java object Error: Trying to link invalid 'this' to a Java object
at new ScanCallBackImpl (file: app/webpack:/bluetooth-worker-test/node_modules/@nativescript-community/ble/index.android.js:466:0)
at new Bluetooth (file: app/webpack:/bluetooth-worker-test/node_modules/@nativescript-community/ble/index.android.js:1004:0)
at handleScanMessage (file: app/webpack:/bluetooth-worker-test/app/bluetooth-worker.ts:25:23)
at globalThis.onmessage (file: app/webpack:/bluetooth-worker-test/app/bluetooth-worker.ts:10:18)
At the moment I suspect the issue is somewhere inside this function:
@AdrianoOP thanks for opening an issue. will help tracking it. I am sorry I did not have time to look at it. will br able to so it next week. would that br good with you ?
@farfromrefug as we were discussing in the discord community, it seems it is an issue related to the android package.
There is a PR opened for that, but while it is not merged an work around can be using the build related to the PR (https://github.com/NativeScript/android/actions/runs/7234213102). You just need to unzip and add it replacing the content inside /platform/android
I'm running into issues with my svelte-native application when I try to instantiate the Bluetooth from the plugin inside my Worker.
I've created a demo project so I could more easily reproduce the issue (https://github.com/AdrianoOP/bluetooth-worker-test). I can make it work perfectly in the main thread, but in the Worker I an error when trying to instantiate the Bluetooth class. Before trying to instantiate the class I'm making sure that permissions have been granted.
Situation happens both with my simulator (Android 13) and cellphone (Android 11)
const communicator = new Bluetooth(); // throws the error below
At the moment I suspect the issue is somewhere inside this function:
ble/src/ble/index.android.ts
Line 539 in 4c4d55e
My package.json files:
package.json
package-lock.json
The text was updated successfully, but these errors were encountered: