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.

'WatchBridge.h' file not found

See original GitHub issue

My AppDelegate.h

#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>

// Push Notifications
#import <UserNotifications/UserNotifications.h>

// WatchConnectivity
@import WatchConnectivity;
@class WatchBridge;

@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, UNUserNotificationCenterDelegate>

@property (nonatomic, strong) UIWindow *window;
@property(nonatomic, strong) WatchBridge *watchBridge;
@property(nonatomic, strong) WCSession *session;

@end

My AppDelegate.m

#import "WatchBridge.h" ==> Error HERE

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSString *GOOGLE_MAPS_APIKEY = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"GOOGLE_MAPS_APIKEY"];
   NSString *URL_BASE = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"URL_BASE"];
  
  [GMSServices provideAPIKey:GOOGLE_MAPS_APIKEY];
  
  [NSThread sleepForTimeInterval:2.0];
  
  NSDictionary *props = @{@"GOOGLE_MAPS_APIKEY" : GOOGLE_MAPS_APIKEY ,@"URL_BASE" : URL_BASE};
  
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"xxxx"
                                            initialProperties:props];

  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  
  // Define UNUserNotificationCenter
  UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
  center.delegate = self;
  
  // Analytics
  [FIRApp configure];
    
  self.watchBridge = [WatchBridge shared];
  self.session = self.watchBridge.session;
    
  return YES;
}

Version:

"react-native-watch-connectivity": "0.2.0",

INFO:

info 
  React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (4) x64 Intel(R) Core(TM) i3-8100B CPU @ 3.60GHz
      Memory: 69.64 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.9.1 - ~/.nvm/versions/node/v8.9.1/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 5.5.1 - ~/.nvm/versions/node/v8.9.1/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 22, 26, 27, 28
        Build Tools: 28.0.3
        System Images: android-22 | Google APIs Intel x86 Atom, android-26 | Intel x86 Atom_64, android-27 | Intel x86 Atom_64, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5522156
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.5 => 0.59.5 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
nstrcommented, Aug 3, 2020

same

0reactions
shehanGurugecommented, Oct 13, 2021
  • $(SRCROOT)/…/node_modules/react-native-watch-connectivity

Hi where should we set this in the Header Search Paths? Since I am also getting the same error! 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

React/RCTBridgeDelegate.h' file not found after using stripe ...
I use workspace button to build my project. For debug build on ios, works 100% fine. But For release build on ios, React/RCTBridgeDelegate.h...
Read more >
React Native Watch Connectivity | ReactJs Component
Communicate with your apple watch apps over the react native bridge. Note: This library does not allow you to write your iWatch apps...
Read more >
seanpeplinski/rnwatch NPM
Communicate with your apple watch apps over the react native bridge. Note: This library does not allow you to write your iWatch apps...
Read more >
“React/RCTLog.h file not found” an… | Apple Developer Forums
h file not found” and “Bad receiver type 'int'”: Misplaced CocoaPods files to blame?
Read more >
React Native build failed: 'React/RCTBridge.h' file not found
iOS : React Native build failed: 'React/RCTBridge. h ' file not found [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
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