Nativescript: Socket connection timed out - nativescript

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.

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

React Native 0.63 not updating main.jsbundle after code changes

I installed the latest version of React 0.63.2 and using XCode v11.6 and I noticed a couple things:
main.jsbundle does not exist and you have to create it first before entering the Terminal command: npx react-native run-ios.
If you make any code changes, the main.jsbundle is not updated when you run the Terminal command: npx react-native run-ios.
Should you be running the XCode project in Debug mode or Release?
Has anyone seen these issues with .63.2?
It seems that the entire problem revolved around my hosts file. I had set uncomment my localhost and it finally worked. I had commented it out a long time ago for my Parallels VM.

Can't deploy nativescript app to ios emulator or real device

I have successfully deployed my nativescript app to my ios and android devices and emulators many, many times. But now, when I try to deploy the app to ios, the builder stops at Project successfully prepared (ios) and won't load it to the emulator or device.
I deleted the hooks, node_modules, and platforms folders, then rebuilt with the same result. I can successfully run the app if I run it directly through XCode, just not from the nativescript cli.
Here's the output from tns doctor
✔ Getting environment information
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 11.6.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 6.7.8 version and is up to date.
✔ Component tns-core-modules has 6.5.12 version and is up to date.
✔ Component tns-android has 6.5.3 version and is up to date.
✔ Component tns-ios has 6.5.2 version and is up to date.
Any idea as to why I can deploy from XCode but not the command line?
I have had similar problems in the past, and it has always meant doing an update of Nativescript and then restarting my system. However, your tns doctor output looks basically the same as mine and I'm not having any issues with this. Not sure what to say -- maybe try a new npm install -g nativescript -- but it looks like you are already up to date. I've found in my experiences that this seems to happen if Xcode has updated and the version of Nativescript I have is one behind. Your situation may be for a different reason. Also, for whatever reason, I also found I need to completely reboot (paradoxical as that sounds) after doing an update to get things working again. That led me to speculate at one point that something in the connectivity layer might get jiggered up and causing things to wait for a ready state that never appears (?) but that doesn't really make much sense either on deeper thought. Wish I had a more definitive suggestion!
I finally found the problem. In my situation, the nativescript-videorecorder plugin has a hook that runs during the after-prepare phase of the build process. The after-prepare script creates a promise that only resolves if it finds the AndroidManifest.xml in the platforms folder. When I delete the platforms folder to do a clean rebuild of ios, the AndroidManifest.xml doesn't exist causing the promise to hang.
If I build for android first, the ios build runs fine and deploys to my simulator and real device.
I notified the owner of nativescript-videorecorder. Hopefully this helps someone else who may have a similar problem with this or another plugin.

Nativescript - trying to run app on device connected to Mac (iOS)

I'm trying to run my app on a phone connected directly to the Mac.
tns run iOS
It's in debug mode - not. signed with production certs etc.
I'm getting the following error:
Unable to apply changes on device: 4d86dddfd4ec1ae761441ed5947acb7c143120e3. Error is: Command xcodebuild failed with exit code 65.
I can run on the emulator fine.
Any help?
Just had that error myself after attaching a new iphone to my computer.
I did tns platform remove ios and then tns platform add ios and it worked.
I had the same issue the last week. Exist some zombie processes and some weird ram issues related with that. I can't log everything :(
I did the following:
Check your current processes in Activity monitor and close everything for the first build.
Run: tns build ios --for-device --team-id TEAM_ID
After that, run: tns run ios --team-id TEAM_ID
Yes, foolish steps but works.
I'll put some logs here when I can.

Nativescript SideDrawer not able to run in iOS emulator but working fine in android

Hit the below when running in iOS emulator but working fine in andriod.
JS ERROR ReferenceError: Can't find variable: TKSideDrawerDelegate
Thanks for the help
Possible solution as originally posted here
I spent quite some time and finally get it work by using the following
steps (in my project folder):
tns platform remove ios
rm -rf node_modules lib platforms
tns plugin add nativescript-telerik-ui
Modify app.module.ts and add the nativescript-telerik-ui directives respectively
In iOS emulator, delete the existing app (I found this is critical)
tns run ios --emulator
I found the critical step seems to first delete the app manually on
iOS emulator after the plugin was added.

React-native AwesomeProject buid failure

I am learning react-native from a Udemy course. I have followed the exact steps used by both my instructor as well as the RN documentation. However, I get 105 errors when I open in XCode (v6.4 on OSX 10.10.1). I tried targeting different builds, but to no avail. A few of the errors I get include
Expected '>'
Expected '}'
All the errors here seem to originate in the external files such as
RCTVibration.m
RCTAssert.h
And so on.
The build tools I used are the ones recommended by fb.
brew install node
npm install -g react-native-cli
react-native init AwesomeProject
cd AwesomeProject
react-native run-ios (Even tried opening it using Xcode in the finder)
On a side note, using Node v4.4.5, react-native cli 1.0.0, Homebrew 0.9.9.
Right up till I build the project, I encounter nothing unusual (Creating the project did take quite long and threw a few warnings at me.) Are there any dependencies I have failed to install? Help is appreciated!
EDIT: I either hadn't observed this before, or this appeared now. Here's the image.
From the React Native Getting Started prerequisites:
Xcode 7.0 or higher. Open the App Store or go to https://developer.apple.com/xcode/downloads/. This will also install git as well.
So you should update your XCode.

Resources