Nativescript: Socket connection timed out

Viewed 2835

I am on Mac and I want to run my app on a USB-C connected Android device.

My first step is always to remove node_modules, hooks and platforms folders, aswell as package.lock.json file. After that I run tns build android. Once the build is completed I either run tns run android or start the application via nativescript sidekick.

But it always ends like this now:

Project successfully built. Installing on device 5B24000362... Successfully installed on device with identifier '5B24000362'. Unable to apply changes on device: 5B24000362. Error is: Socket connection timed out..

Since I had this error already 2 days ago and could not continue working on the App, I updated all nativescript and angular dependencies following this upgrade instructions. After that update, the app worked again. But now after a few hours I get the same error again (same app). I even pushed the app to a git repository after it worked, and recloned it now, does not work.

4 Answers

If you have nativescript-plugin-firebase installed. Just update it with:
$ tns plugin update nativescript-plugin-firebase

I ran into this same issue. Interestingly, in my case, it was because the emulated device did not have enough storage to install the app. As soon as I deleted some other builds off of it, it worked.

Make sure you are using the latest NativeScript tooling, not only the dependencies. You can install the latest CLI by executing npm i -g nativescript.

If the application is not started at all, you can check this answer to a similar issue in NativeScript CLI GitHub repository.

I finally got this working by removing admob from node_modules\nativescript-plugin-firebase\platforms\android\include.gradle

Line to take out:

Related