NathanaelA / nativescript-websockets

Websockets for NativeScript
83 stars 43 forks source link

Exception Crash on using on IOS - PSWebSocketDelegate #83

Closed grgrcn closed 3 years ago

grgrcn commented 4 years ago

HI Nathanael, I use your plugin in Nativescript-Vue app on my IPhone8 on NativeScript Sideckick. I test the app with Sidekick Preview App, but whe I add

var WS = require('nativescript-websockets');

to my code che app crash with this msg:

... at promiseReactionJob([native code]) 2020-05-04 17:49:09.413 nsplaydev[340:36394] JavaScript error: file:///app/vendor.js:15361:34: JS ERROR ReferenceError: Can't find variable: PSWebSocketDelegate 2020-05-04 17:49:09.414 nsplaydev[340:36394] PlayLiveSync: Uncaught Exception 2020-05-04 17:49:09.415 nsplaydev[340:36394] PlayLiveSync: Sending crash report ...

If I use the same on Android work good...

Do you cam help me? Tks

NathanaelA commented 4 years ago

Please do a tns platform clean ios

When you install it; sometimes nativescript doesn't reset the platforms folder so when you rebuild it doesn't include the PSWebSocketDelegate into the app.

grgrcn commented 4 years ago

Sorry Nathanael, I execute tns platform clean ios and I then reinstalled the plugin but te resul is the same... I also retry after drop the the folder platforms\ios and reinstalled the plugin...

... at asyncFunctionResume([native code]) at [native code] at promiseReactionJob([native code]) 2020-05-04 18:19:55.151 nsplaydev[366:41153] JavaScript error: file:///app/vendor.js:15361:34: JS ERROR ReferenceError: Can't find variable: PSWebSocketDelegate 2020-05-04 18:19:55.152 nsplaydev[366:41153] PlayLiveSync: Uncaught Exception 2020-05-04 18:19:55.153 nsplaydev[366:41153] PlayLiveSync: Sending crash report 2020-05-04 18:19:59.155 nsplaydev[366:41153] *** JavaScript call stack: ....

:(

G.

grgrcn commented 4 years ago

I had read the that'sthe solution, and I had already tried... Can help you I attach all the application log... Tks G. log.txt

NathanaelA commented 4 years ago

Hmm, that seems really weird; I've never seen this issue unless your platforms was using the version without being reset. I'll upgrade the demo and see what happens...

  1. Is this NS 6.5?
  2. Is this on emulator or real device?
grgrcn commented 4 years ago
  1. NS Version 6.3.0
  2. Real Device - IPhone8 IOS 12.4.5

Now, try to upgrade NS 6.5.

grgrcn commented 4 years ago

Hi Nathanael, I update NS to 6.5 but not work....

I noticed this in the NS console log:

[20-05-04 21:35:59.201] (CLI) Plugin nativescript-websockets is not included in preview app on device 1470236D-6571-4C8B-B5BD-466EB124EE09 and will not work. [20-05-04 21:35:59.206] (CLI) In the app are used one or more NativeScript plugins with native dependencies. [20-05-04 21:35:59.206] (CLI) Those plugins will not work while building the project via $ tns preview. Please, use $ tns run <platform> command instead. [20-05-04 21:35:59.215] (CLI) Preparing project... [20-05-04 21:36:02.056] (CLI) Bundling application for entryPath .\app...

and if I run tns run command (or other tns command for IOS) NS say:

Applications for platform iOS can not be built on this OS

I use NS a W10, Could this be the problem?

Tks G.

NathanaelA commented 4 years ago

If you are using the tns preview than yeah, this won't work. How are you running it?

grgrcn commented 4 years ago

Hi Nathanael, yes I use plugin from NS Sidekick and lauch my app from "Preview App"... I try use NS Sidelick on macOS also, but nothing... Is there any way to solve this problem? On Android it also works well from Sidekick ... why not on IOS?

Tks G.

NathanaelA commented 4 years ago

Unfortunately, if you are using the NativeScript Preview app; this won't ever work. The WebSockets requires actual compiled components and the preview app only uses the JavaScript.