Skip to content
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

Service exited due to signal: Killed: 9 #1816

Closed
hdeshev opened this issue Jun 8, 2016 · 38 comments
Closed

Service exited due to signal: Killed: 9 #1816

hdeshev opened this issue Jun 8, 2016 · 38 comments

Comments

@hdeshev
Copy link
Contributor

hdeshev commented Jun 8, 2016

From @burkeholland on March 4, 2016 14:58

NativeScript Version: 1.6.1

I'm unable to use Angular 2 with NativeScript at the moment. I'm using the template-hello-world-ng project.

The error I get isn't terribly helpful....

Project successfully built.
Using  /Users/burkeholland/dev/burkeholland/my-app-name/platforms/ios/build/emulator/myappname.app
Starting iOS Simulator
Mar  4 08:15:53 --- last message repeated 1 time ---
Mar  4 08:15:53 hollandmac com.apple.CoreSimulator.SimDevice.FAE7B936-79CE-46C4-859F-65506A603837.launchd_sim[52478] (UIKitApplication:org.nativescript.myappname[0x71cd][52664]): Service exited due to signal: Killed: 9

Steps to recreate:

tns create my-app-name --template https://github.com/NativeScript/template-hello-world-ng

cd my-app-name && tns platform add ios

tns run ios --emulator

Copied from original issue: NativeScript/nativescript-angular#101

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @burkeholland on March 4, 2016 15:33

Updating with possible related race condition error on iOS Simulator. Could be cause by app size.

https://forums.developer.apple.com/thread/25221

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @rosen-vladimirov on March 4, 2016 15:35

It looks like there are some problems when deploying application to iOS Simulator related to project's size. Some information can be found here:
https://forums.developer.apple.com/thread/25221
As a workaround the following commands can be used:

tns deploy ios --emulator --justlaunch
tns run ios

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @burkeholland on March 4, 2016 15:56

👍

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @burkeholland on March 7, 2016 17:45

It appears to me that livesync is not syncing changes from the TypeScript. Changes their require me to run the deploy command all over again.

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @jlooper on April 4, 2016 15:2

I get this error consistently on iOS emulator when running Angular+{N} apps unless I use the deploy/livesync command above. It's a big workflow stopper for me :(. Hoping to get livesync working for iOS soon as well.

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @tjvantoll on April 15, 2016 19:9

I’m going to open this up, because I know at least @burkeholland, @jlooper, and @sebawita are still having this issue, and I think we need to come up with some way to workaround the problem.

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @tjvantoll on April 22, 2016 12:52

I can confirm that this issue is fixed when using Xcode 7.3 and version 2.0 of the {N} CLI, so I’m going to close this issue for now. If anyone hits this after upgrading to the soon-to-be-released 2.0 CLI please comment so we can look into this.

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @jlooper on April 27, 2016 16:49

I do see this issue if using tns emulate ios or tns run ios --emulator with Xcode 7.3 and {N} 2.0. The workaround is to make sure Xcode is closed, reset the simulator (Simulator > Reset Content and Settings) and type:

  1. Call tns run ios --justlaunch (Make sure you do not have any iOS devices attached.
  2. Call tns livesync ios --watch

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @georgeedwards on May 1, 2016 14:56

I also face the same issue using 2.0, XCode 7.3 and OSX El Capitan, but it does work with tns run ios --justlaunch

livesync doesn't work for me, so I haven't found a way to get a console.log yet - really annoying

However, when running on a real device, the app launches without issue

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @rdlauer on May 9, 2016 20:56

Same issue here with {N} 2.0 + Xcode 7.3.1. The --justlaunch flag is like magic, but far less convenient.

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @cfjedimaster on June 2, 2016 18:41

I ran into this today. It took me about 10 relaunches or so for it to finally work. I'd seriously consider adding a note someplace in the docs for folks going through the tutorial.

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @tjvantoll on June 3, 2016 13:39

Reopening this because clearly people are still hitting the problem.

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @tjvantoll on June 3, 2016 14:18

@cfjedimaster Warning added in NativeScript/docs@0aebd98. Thanks for the feedback as always.

@hdeshev
Copy link
Contributor Author

hdeshev commented Jun 8, 2016

From @dwehrmann on June 7, 2016 7:24

+1 also having this problem.
tns run ios --emulator exits with Signal: Killed 9

tns run ios --justlaunch works for me, but livesync doesn't. I think that's a real showstopper – does anybody have a workaround?

jlooper's advice doesn't work for me:
Project successfully prepared Executing before-livesync hook from /Users/SB3/www/mobile-dev/groceries/sample-Groceries/hooks/before-livesync/nativescript-angular-sync .js Transferring project files... Successfully transferred all project files. Applying changes... Successfully synced application org.nativescript.groceries on device A451650D-0FF3-4508-B5AB-7DB59D552076. Executing before-watch hook from /Users/SB3/www/mobile-dev/groceries/sample-Groceries/hooks/before-watch/nativescript-dev-typescript.js Found peer TypeScript 1.8.10 Jun 7 09:12:22 SB3 com.apple.CoreSimulator.SimDevice.A451650D-0FF3-4508-B5AB-7DB59D552076.launchd_sim[36659] (UIKitApplication:org.nativescript.groceries[0x6d43][77918]): Service exited due to signal: Killed: 9

@VladimirAmiorkov
Copy link

VladimirAmiorkov commented Jun 30, 2016

I noticed that manually starting the project via the build xcode project is another way to workaround this inconvenience atm. Do the following:

In the terminal execute tns prepare ios then go to platforms/ios, open the .xcodeproj and run its as normally you would in xcode.

Its a slower way to run but it deploys 100% of the time.

@heavymery
Copy link

heavymery commented Jul 1, 2016

I had same issue. tns run ios --emulator fail with Service exited due to signal: Killed: 9 error. But tns livesync ios --emulator --watch works for me. Can you guys try this command?

Ah, It seems that this issue solved from latest tns 😮


In my case, I tried tns run ios --emulator from sample project NativeScript/sample-Groceries. I noticed package.json was changed like this when I added platforms ios/android.

   "nativescript": {
     "id": "org.nativescript.groceries",
     "tns-ios": {
-      "version": "2.0.0"
+      "version": "2.1.0"
     },
     "tns-android": {
-      "version": "2.0.0"
+      "version": "2.1.1"
     }
   },
   "dependencies": {
     "tns-core-modules": "2.0.0"
   ...

Maybe, tns-core-modules's version was mismatch? I upgraded tns-core-modules according to this guide upgrade-instructions#upgrading-tns-modules.

   "nativescript": {
     "id": "org.nativescript.groceries",
     "tns-ios": {
-      "version": "2.0.0"
+      "version": "2.1.0"
     },
     "tns-android": {
-      "version": "2.0.0"
+      "version": "2.1.1"
     }
   },
   "dependencies": {
-    "tns-core-modules": "2.0.0"
+    "tns-core-modules": "^2.1.0"
   ...

Then, tns run ios --emulator works fine 😄

@realityfilter
Copy link

This problem still exists and the issue should be reopened.
Steps to reproduce:

tns create test-nativescript-angular --ng
tns run ios --emulator

tns version 2.2.0
Xcode 7.3.1
simulator 8.4 and 9.3

@juanpujol
Copy link

Had the same problem today. I'm unable to init the ios simulator.

@VladimirAmiorkov
Copy link

@juanpujol try #1816 (comment)

@juanpujol
Copy link

Thanks @VladimirAmiorkov that worked. But still, this issue should be reopened, don't you think?

Is there a way to use livereload from Xcode? Thanks.

@VladimirAmiorkov
Copy link

@juanpujol if you mean livesync then am afraid the answer is no. The mentioned method is basically manually running the created by nativescript native project and as livesyncis not a native feature it is not available.

@juanpujol
Copy link

Ok, thank you.

@tgrecojs
Copy link

I was just having a bunch of trouble with this but this seemed to resolve it. For some reason, it won't allow me to run tns run ios --emulator, but the command below works.

tns run ios --justlaunch --watch

I was able to get this going without having to downgrade any of my dependencies as well. Below are some contents from my package.json file.

  "tns-ios": {
      "version": "2.2.1"
    }
  },
  "dependencies": {
    "@angular/common": "2.0.0-rc.4",
    "@angular/compiler": "2.0.0-rc.4",
    //other deps
    "nativescript-angular": "^0.3.0",
    "reflect-metadata": "^0.1.5",
    "tns-core-modules": "2.2.1"
  }, //....

@davorpeic
Copy link

Pointed here from groceries tutorial, but can't find the "workaround" tutorial mentioned. At this moment the only way that works is to execute ios app from xcode.

@vakrilov
Copy link

vakrilov commented Nov 8, 2016

The issue is still there - it happens to me when running the ng-sample project. It does not happen every time and hard to reproduce 100% of the time.
Some observations:

  • Reseting the iOS emulator sometimes helps.
  • Live-sync-ing sometimes helps.
  • If you have a clean run(git clone, npm i, tns run ios) - it is more likely to get it

@jzgoda
Copy link
Contributor

jzgoda commented Nov 25, 2016

@thomasjosephgreco thanks!
tns run ios --emulator --justlaunch --watch seems to work great for me.

@zakdances
Copy link

This is almost certainly memory related. I see this error much more frequently in low memory conditions on my dev machine.

@tsonevn tsonevn added this to the 2.5.0 milestone Dec 5, 2016
@berardo
Copy link

berardo commented Dec 24, 2016

I left a comment on nativescript-angular issue # 101 but looks like it's duplicate from here.

I've attacked in so many different ways in order to get the simulator working but no luck so far.
tns run ios and also tns run ios --justlaunch + tns livesync ios --watch don't work even when the app is the taps counter.
Tried using webpack to have a smaller build, also tried to upgrade OS and xcode versions but nothing seems to help.
It might worth reporting that it takes ages to spin up the simulator and even default apps, like Settings, don't work sometimes. But they do after several attempts (I mean being stupid enough to hit their icons and wait for them ending up crashing in a frenetic loop).
Regarding my build, the maximum I can see is the splashscreen and then it closes (due to Kill 9 signal).
I was wondering if there is any log file to check for errors or a config file to force using more memory or something like that.
Thanks

@Plamen5kov Plamen5kov removed this from the 2.5.0 milestone Jan 27, 2017
@BramscoChill
Copy link

I had the same issue, Service exited due to signal: Killed: 9. I was running MacOs Sierra in Vmware. I was using 4gb of ram and the vm was placed on an normal hard disk. My pc got 16 GB of RAM, when I assigned 8gb to the VM and moved it to my SSD drive, everything was working fine.

@davorpeic
Copy link

I see 2.5 is out, didn't check yet, but I hope this is fixed..

@davorpeic
Copy link

davorpeic commented Feb 10, 2017

Still present in 2.5.
Creating simple ng app
tns create DemoApp --ng and tns run ios drops the same error, have more then 10gb of memory free, so I would eliminate memory as issue in my case.

@nabil-mansouri
Copy link

Hi ! i have the same issue. I need to restart my imac everytime because of this error. No news about it?

@etabakov etabakov added this to the 3.1.0 milestone Apr 27, 2017
@pkoleva pkoleva removed this from the 3.1.0 milestone Jun 6, 2017
@pkoleva
Copy link
Contributor

pkoleva commented Jul 14, 2017

Hey all @nabil-mansouri , @davorpeic

If you still encounter this problem could you send us exact steps to reproduce, please.

Thanks!

@mictay
Copy link

mictay commented Aug 25, 2017

Hi, yes i have the same issue. The whole livesync solution feels fragile and some sort of race condition issue is happening(which I attribute to sometimes it works, sometimes it doesn't). Once in awhile when it fails, I'll see something about hooks an a permission issue (just speculating). When I'm lucky, I don't see this issue, unfortunately, I see it more often than not so rather than fight it, I've come to terms with just using my work around.

btw, livesync and --watch are no longer published documented command line options for tns 3.1.3 so don't try those with previously above 2016 mentioned work arounds. For me, this is what I'm having to do.

Two different terminals... 1st one to build/deploy/run the code, 2nd one to watch the terminal. Everytime I make a change, I re-run the 1st terminal command again...

First Terminal

tns run ios --device <device-id> --justlaunch

Second Terminal

tns device log --device <device-id>

@pkoleva what type of activity and logs can I send you to help give you the "need more info" you are looking for. You're welcome to contact me directly or just ask Jen Looper for my contact info if you like.

@pkoleva
Copy link
Contributor

pkoleva commented Aug 25, 2017

Hi @QuinnZillian,

If you can isolate the problem, using our latest bits, it will be very helpful for us to have the specific steps to reproduce. You can send us the versions of node and npm you use, what kind of devices or simulators you use to recreate the error, your OS and xCode versions. Also if you could send us the output of tns run ios --log trace when you get the "Service exited due to signal: Killed: 9" error, it will help investigating further.

Indeed livesync and --watch are deprecated for a couple of releases already. The way we sync files now is by running tns run <platform> and it watches for changes automatically by default. However, using --justlaunch just builds and deploys the app on all connected devices and does not sync.

@mictay
Copy link

mictay commented Aug 27, 2017

Hi @pkoleva Here's what you've asked for. Good Luck!!!!

Let me know if there is anything else I can provide.

tns --version
macbooks-MacBook-Pro:mow-app Michael$ tns --version
3.1.3
macbooks-MacBook-Pro:mow-app Michael$ tns doctor
Verifying CocoaPods. This may take more than a minute, please be patient.
nativescript-check-cocoapods@0.0.1 /private/var/folders/tx/c73yn43x5qgf2thyb2tss3z40000gq/T/nativescript-check-cocoapods117727-73320-1ynb5yo.0sydivbo6r
└── tns-ios@3.1.0 

npm WARN nativescript-check-cocoapods@0.0.1 No description
npm WARN nativescript-check-cocoapods@0.0.1 No repository field.
npm WARN nativescript-check-cocoapods@0.0.1 No license field.
  ◞ Verifying CocoaPods. This may take some time, please be patient..
Your components are up-to-date.

No issues were detected.

Here's a tail snippet of the trace log. The full trace can be found in the trace.zip

Aug 27 03:49:57 --- last message repeated 6 times ---
objc[73159]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x119adccc0) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x1198f36f0). One of the two will be used. Which one is undefined.
3:50:00 AM - Compilation complete. Watching for file changes.

Hook completed
Project dir from hooksArgs is: /git/cs/develop/mow-mobile-beta/mow-app.
Hooks directories: [ '/usr/local/lib/node_modules/nativescript/lib/hooks',
  '/usr/local/lib/node_modules/nativescript/lib/common/hooks',
  '/git/cs/develop/mow-mobile-beta/mow-app/hooks' ]
AfterHookName for command liveSync is after-liveSync
Aug 27 03:50:04 macbooks-MacBook-Pro com.apple.CoreSimulator.SimDevice.23BE09E6-5E38-4431-9D9A-25AC5E036C3D.launchd_sim[62891] (UIKitApplication:com.celebrationsoftware.ns.mow[0x9dca][62913][73159]): Service exited due to Killed: 9

File contains the trace log and a screen shot of the versions
trace.zip

@rosen-vladimirov
Copy link
Contributor

Hey @QuinnZillian ,
Its been a while since we were looking at this issue. I would like to share some details about our suspicions what might be causing it. In some cases, when the application is installed on iOS simulator and you try to launch it really fast, the application is being killed and you receive an error Service exited due to Killed: 9. As described in this thread:

There is a potential race condition between install and launch, 
and it looks like you're reliably loosing that race. 
SpringBoard sends SIGKILL to a running process when 
its app bundle is updated, but in this case, 
we actually launched it after the install 
before SpringBoard got notified of the install.

The problem might occur on iOS 8 simulators (at least according to the same thread) or in case there's some issue in CLI that makes it change the app bundle during launch of application. We have not found such issue in CLI so far, so I assume you were using iOS 8 simulator.
I know its been a while, so I would like to ask you to try the steps you've described in your post and inform us if you still reproduce the issue.

Thanks in advance for your help.

@rosen-vladimirov
Copy link
Contributor

Hey guys,
As we have not received reports for similar issue with the latest versions, we are closing this issue. We've applied additional changes in our code that should prevent this issue and we they will be included in the next official release.

Please open a separate issue in case you face the same problem again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests