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.

Watchman Error, cannot deploy to device

See original GitHub issue

I’ve been looking all day for a solution, and either I’m looking in the wrong places, or this error hasn’t been seen yet.

I’m trying to deploy my app to my iPhone 6 (iOS 9.3) in Release mode. This is my AppDelegate.m:

/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

#import "AppDelegate.h"

#import "RCTRootView.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation;

  /**
   * Loading JavaScript code - uncomment the one you want.
   *
   * OPTION 1
   * Load from development server. Start the server from the repository root:
   *
   * $ npm start
   *
   * To run on device, change `localhost` to the IP address of your computer
   * (you can get this by typing `ifconfig` into the terminal and selecting the
   * `inet` value under `en0:`) and make sure your computer and iOS device are
   * on the same Wi-Fi network.
   */

  //jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];

  /**
   * OPTION 2
   * Load from pre-bundled file on disk. The static bundle is automatically
   * generated by the "Bundle React Native code and images" build step when
   * running the project on an actual device or running the project on the
   * simulator in the "Release" build configuration.
   */

  jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"◼︎◼︎◼︎◼︎"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  return YES;
}

@end

It boots up fine in Debug mode, but when I try to bundle it for release, the build fails and I get the following error from watchman:

[sane] Warning: Lost connection to watchman, reconnecting..
[sane] Warning: Lost connection to watchman, reconnecting..
2016-04-15T16:33:51,872: [cli] failed to identify PDU: fill_buffer: EOF
2016-04-15T16:33:51,874: [cli] unable to talk to your watchman on /usr/local/Cellar/watchman/4.4.0/var/run/watchman/%n-state/sock! (Undefined error: 0)

2016-04-15T16:33:51,873: [cli] failed to identify PDU: fill_buffer: EOF
2016-04-15T16:33:51,874: [cli] unable to talk to your watchman on /usr/local/Cellar/watchman/4.4.0/var/run/watchman/%n-state/sock! (Undefined error: 0)

Watchman:  watchman--no-pretty get-sockname returned with exit code 1 2016-04-15T16:33:51,873: [cli] failed to identify PDU: fill_buffer: EOF
2016-04-15T16:33:51,874: [cli] unable to talk to your watchman on /usr/local/Cellar/watchman/4.4.0/var/run/watchman/%n-state/sock! (Undefined error: 0)

 ERROR  watchman--no-pretty get-sockname returned with exit code 1 2016-04-15T16:33:51,873: [cli] failed to identify PDU: fill_buffer: EOF
2016-04-15T16:33:51,874: [cli] unable to talk to your watchman on /usr/local/Cellar/watchman/4.4.0/var/run/watchman/%n-state/sock! (Undefined error: 0)

Error: watchman--no-pretty get-sockname returned with exit code 1 2016-04-15T16:33:51,873: [cli] failed to identify PDU: fill_buffer: EOF
2016-04-15T16:33:51,874: [cli] unable to talk to your watchman on /usr/local/Cellar/watchman/4.4.0/var/run/watchman/%n-state/sock! (Undefined error: 0)

    at ChildProcess.<anonymous> (/Users/jonlaing/projects/Partisan/node_modules/fb-watchman/index.js:198:18)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

Versions

  • OSX 10.11.4
  • Xcode 7.3
  • react-native 0.23.1
  • node 5.0
  • npm 3.3.6
  • watchman 4.4.0

I’m not all that familiar with the inner workings of all this, so any help would be greatly appreciated. Thanks for your time!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10

github_iconTop GitHub Comments

3reactions
iSimarcommented, Nov 4, 2016

Hey did you find a solution for this? I’m getting the same problem screen shot 2016-11-03 at 9 51 03 pm

3reactions
jonlaingcommented, Apr 15, 2016

Oh, for the record, I’ve tried uninstalling and reinstalling watchman via homebrew, including doing it with the --HEAD parameter, and I still get the same issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Watchman - Meta Open Source
Organizations with large trees may wish to deploy the root_restrict_files configuration option so that watchman will only allow watching project roots. Close ...
Read more >
Cannot deploy with npm run Deploy in React on github pages
I managed to fix it by setting my git config user name and email. (As the link provided above specifies the need of...
Read more >
Watchman dashboard showing "There is an error in the software ...
Solution · Alert in Watchman occurs when chiefact.txt file contains "badinput" or "badinstall" in log · To resolve issue roll over logs in...
Read more >
Troubleshooting: Cannot Deploy to the iOS Device - RAD Studio
Uninstall the existing application in the target device, and try to run your application again. In Project > Options > Provisioning, select the...
Read more >
How Run and Test React Native / Expo On Your Apple iOS ...
16:27Couldn't start project on Android: Error running adb: No Android device found. Please connect a device and follow the instructions here to enable...
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