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.

Cannot set property 'socket' of null

See original GitHub issue

After upgrading our project to 4.2 , we’ve experiencing socket connections problems to a real device when tns run android

Worth to mention that tns run android does work with emulators ( both Geny & AVD) , but it doesn’t work with real devices ( my Galaxy s8+ and a colleague’s Galaxy s8 , non rooted regular device)

C:\projects-web-storm\digital\dsapp1>tns info
√ Getting NativeScript components versions information...
√ Component nativescript has 4.2.1 version and is up to date.
√ Component tns-core-modules has 4.2.0 version and is up to date.
√ Component tns-android has 4.2.0 version and is up to date.
× Component tns-ios is not installed.

When tns run android :

we get :

Unable to apply changes on device: ce031713a8d0149e0d. Error is: Socket connection timeouted..
Executing after-watch hook from C:\projects-web-storm\digital\dsapp1\hooks\after-watch\nativescript-dev-sass.js
Executing after-watch hook from C:\projects-web-storm\digital\dsapp1\hooks\after-watch\nativescript-dev-typescript.js
Stopping tsc watch
Executing after-watch hook from C:\projects-web-storm\digital\dsapp1\hooks\after-watch\nativescript-dev-webpack.js
TypeError: Cannot set property 'socket' of null
    at Timeout.tryConnect [as _onTimeout] (C:\Users\royin\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\android-livesync-tool.js:298:51)
    at ontimeout (timers.js:482:11)
    at tryOnTimeout (timers.js:317:5)
    at Timer.listOnTimeout (timers.js:277:5)

–> Video showing the problem <–

The app IS installed but not invoked. ( it used to work) before upgrade. We have to tap the launch icon in order to see the app running PackageID is the same in all files ( manifest / packagejson)

BTW - if you want a real project that produces it , I can send privately.


Windows machine , Android , Antivirus & firewall is disabled , uninstalled App from device.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
opsionalcommented, Aug 12, 2018

I’m to, on Android 4.4.2 (real device), but after re-run app works.

1reaction
iguissoumacommented, Aug 12, 2018

Hello @dtopuzov ,

I’m facing the problem on device and emulator. Emulator: Nexus 5X API 27 Device: Asus Zenfone 2 - Android version 6.0.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot set property 'socket' of null · Issue #3818 - GitHub
Hi @RoyiNamir, Can you try to clear the npm cache via npm cache clear delete platforms , node_modules , hooks folders and package-lock.json...
Read more >
Uncaught (in promise) TypeError: Cannot set properties of null ...
I think it's about how you use that ref. You should use the ForwardRef construction.
Read more >
Uncaught TypeError: Cannot set property 'innerHTML' of null
Uncaught TypeError : Cannot set property 'innerHTML' of null. I'm trying to change the text of a list component based on data I've...
Read more >
typeerror: cannot set properties of undefined (setting 'status')
The error is that can't set "whatever" on undefined . This is this line of code: window.localAudio.srcObject = stream; and it means localAudio...
Read more >
How To Fix 'Uncaught TypeError: Cannot set properties of null'
How To Fix 'Uncaught TypeError: Cannot set properties of null ' - JavaScript Debugging.
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