-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tns run ios shows "no reachable hosts" after running unit tests #3146
Comments
I have now reproduced this on two computers. |
@jschwartz73 try the suggestions below
|
I tried the workaround and it does not solve the issue. Any other suggestions? |
@jschwartz73 I was experiencing the same thing, it looks like running the tests might have changed Basically you need to make that file looks something like this
In your case I bet main points to the unit test runner and not the app itself. Could anyone give some info on when that file gets changed and whether or not it should or shouldn't be in version control? |
Hey all,
Meanwhile, I've reproduced and confirmed that the following workflow does not work:
|
@rosen-vladimirov as per request:
I've only been developing with iOS thus far as the project I'm working on only requires iOS at this time. No local plugins, just a vanilla install using the cli. |
npm -v: 5.4.2 I can reproduce the problem every time using these steps:
I'll film a short screencast to demonstrate |
@rosen-vladimirov Hi. I got the same issue reproduced on Android. Steps are the same as for iOS npm -v: 5.3.0 |
NPM -V = 5.5.1 |
I'm now running: |
I'm getting this too... Only after running tests i can't run the app again on emulator or device. I get a 'no reachable hosts error' After i do |
Same thing with this configuration: |
This is still reproducible, and the |
Same thing with this configuration: |
I tried reverting the package.json and was still getting the "no reachable hosts" screen. I was able to get my app back to normal by removing the platforms folder and rebuilding the app again. Once you run "tns test [platform]>, you'll be back to the "no reachable hosts" screen. |
I simply run this now after
Added an alias to my bash and have been using it with 100% success rate. Quite annoying, but works. |
So, this means that running the application and unit testing can't happen simultaneously, correct? That's a bummer. |
IOS |
I execute this command after testing: sed -i.bak 's|./tns_modules/nativescript-unit-test-runner/||' platforms/ios/*/app/package.json it resets the package.json file and is faster than rebuilding the platforms folder
in nativescript-unit-test-runner/lib/after-prepare.js:
adding an import, function, & export to node_modules/nativescript-dev-webpack/projectHelpers.js
and changing node_modules/nativescript-dev-webpack/index.js:
|
I am seeing this as well when building for Android using the sample Angular project however if after running
I modify any file in the project, then
works correctly. If I run the two commands consecutively without making any edits, I get the "no reachable hosts" error. |
@Yermo , You need to add the following code to your
|
@Fatme I am working with the sample app created using
under Ubuntu. There is no AndroidManifest.xml file under App_Resources/Android but there is one under App_Resources/Android/src/main/AndroidManifest.xml I added the android:usesCleartextTraffic="true" line to that file but it has no effect. I still get "no reachable hosts" attempting to run the app after running tests. |
Getting this same error first time using nativescript. Btw, some of the docs explicitly have you run This seems like a terrible blocker for folks that are just getting started with NativeScript and a great annoyance to existing users. Seems like it should be somewhat high on the list of bug fixes to tackle and it's been open for over a year. I'd imagine that there are a number of folks that have given up before really ever getting started. That said, thanks for all the tooling and nice job on most of the rest of the on-ramp process. This was just a minor hiccup, albeit a rather nasty one, along the way. Btw, I was also able to sucessfully use the fixup commands above (platform rebuild & sed). Except that in my case the entry point was main.js, so |
Try to use @Fatme suggestion from NativeScript/nativescript-cli#3146. Didn't work.
Try to use suggestion at NativeScript/nativescript-cli/issues/3146#issuecomment-457689386. no luck
With current
With new workflow you skip the |
After running unit tests via
a call to
displays an app with a big image of "N" and a label that says "no reachable hosts"
My expectation is that the app would run (not the unit tests)
tns info
nativescript │ 3.2.1 │ 3.2.1 │ Up to date │
tns-core-modules │ 3.2.0 │ 3.2.0 │ Up to date │
tns-android │ │ 3.2.0 │ Not installed │
tns-ios │ 3.2.0 │ 3.2.0 │ Up to date │
Steps to reproduce:
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: