React-native-firebase: Build error FirebaseInvites.m ÷÷

Created on 20 Jun 2019  ·  19Comments  ·  Source: invertase/react-native-firebase


Issue



I'm getting a build error after upgrading to 5.5.0.
error: Build input file cannot be found: '/Users/blah/Code/react-native-firebase-starter/node_modules/react-native-firebase/ios/RNFirebase/invites/RNFirebaseInvites.m'

I see FirebaseInvites has been removed in favor dynamic links in this version. How do I rid myself of these old references?


Project Files






iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'SharkPick' do
  # Pods for SharkPick
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Required by RNFirebase
  pod 'Firebase/Core', '~> 5.20.1'

  # [OPTIONAL PODS] - comment out pods for firebase products you won't be using.
  # pod 'Firebase/AdMob', '~> 5.20.1'
  pod 'Firebase/Auth', '~> 5.20.1'
  pod 'Firebase/Core', '~> 5.20.1'
  pod 'Firebase/Database', '~> 5.20.1'
  pod 'Firebase/Functions', '~> 5.20.1'
  pod 'Firebase/DynamicLinks', '~> 5.20.1'
  pod 'Firebase/Firestore', '~> 5.20.1'
  # pod 'Firebase/Invites', '~> 5.20.1'
  pod 'Firebase/Messaging', '~> 5.20.1'
  pod 'Firebase/RemoteConfig', '~> 5.20.1'
  pod 'Firebase/Storage', '~> 5.20.1'
  pod 'Firebase/Performance', '~> 5.20.1'
  pod 'Fabric', '~> 1.9.0'
  pod 'Crashlytics', '~> 3.12.0'

  pod 'GoogleSignIn', '~> 4.4.0'
  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'DevSupport',
   'RCTText',
   'RCTNetwork',
   'RCTWebSocket',
   'RCTAnimation',
    # Add any other subspecs you want to use in your project
  ]
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  # Third party deps podspec link
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

end

target 'SharkPick-tvOS' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for SharkPick-tvOS

  target 'SharkPick-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

#### `AppDelegate.m`:
/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <Firebase.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [FIRApp configure];
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"SharkPick"
                                            initialProperties:nil];

  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];
  return YES;
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

@end


Build Error iOS Invites

Most helpful comment

Would you believe this bit me tonight!? My own release 🤣

I dislike GUI based solutions because automation is reproducible. So I found this set of commands to clear the Xcode build cache, and when I added it to my build (which already nukes ios/Pods and ios/build and node_modules) it did the trick:

killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*

https://gist.github.com/maciekish/66b6deaa7bc979d0a16c50784e16d697

All 19 comments

npm i react-native-clean-project && npx react-native clean-project-auto

Good luck :-)

npm i react-native-clean-project && npx react-native clean-project-auto

Good luck :-)

@mikehardy Did not help for me.

sorry, there is something wrong with your local environment though. CI builds the thing from scratch, it works. Those files are gone but no longer included, so you've got some sort of local file staleness issue going on. https://github.com/mikehardy/rnfbdemo shows it working even

@mikehardy Thanks for reply but as i can see https://github.com/mikehardy/rnfbdemo uses old firebase pod versions '5.20.2' new documentation requires '6.2.0' after 5.5.0 update. Maybe you can get same error after updating pod versions?

@GoktuqCan So I encountered the error again, and trying npm i react-native-clean-project && npx react-native clean-project-auto didn't work the second time. The first time it did.

I cleaned out build and build folder cache in Xcode (https://macpaw.com/how-to/clear-xcode-cache), then unlinked RNFirebase using react-native unlink react-native-firebase. Then I ran npm i react-native-clean-project && npx react-native clean-project-auto. npm install, pod install, then try the build again.

Similarly - I updated rnfbdemo to 6.3.0 pods (current) and it built fine. I have some unrelated thing popping up there now but it wasn't an invites build error any more

Though if you unlink, you should move your Podfile out of the way before you relink, or the link will try to link react-native-firebase via Pods which is not recommended for v5 - subtle things these iOS builds!

@GoktuqCan So I encountered the error again, and trying npm i react-native-clean-project && npx react-native clean-project-auto didn't work the second time. The first time it did.

I cleaned out build and build folder cache in Xcode (https://macpaw.com/how-to/clear-xcode-cache), then unlinked RNFirebase using react-native unlink react-native-firebase. Then I ran npm i react-native-clean-project && npx react-native clean-project-auto. npm install, pod install, then try the build again.

@ealmiladi Thanks for reply and link you provide. 1st, 2nd, 4th steps worked for me.
But i didn't use npm i react-native-clean-project && npx react-native clean-project-auto

Would you believe this bit me tonight!? My own release 🤣

I dislike GUI based solutions because automation is reproducible. So I found this set of commands to clear the Xcode build cache, and when I added it to my build (which already nukes ios/Pods and ios/build and node_modules) it did the trick:

killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*

https://gist.github.com/maciekish/66b6deaa7bc979d0a16c50784e16d697

I must say by the way, thank you @GoktuqCan and @ealmiladi for sticking with this one and figuring it out, it helped me personally and if the linked react-native-clean-project issue is resolved, this will be one of those “solved for everyone forever” things. 💪

I must say by the way, thank you @GoktuqCan and @ealmiladi for sticking with this one and figuring it out, it helped me personally and if the linked react-native-clean-project issue is resolved, this will be one of those “solved for everyone forever” things. 💪

Everybody wins, love it! Thanks for following up.

I must say by the way, thank you @GoktuqCan and @ealmiladi for sticking with this one and figuring it out, it helped me personally and if the linked react-native-clean-project issue is resolved, this will be one of those “solved for everyone forever” things. 💪

This is what open source all about, thanks. Also thanks for this amazing project.

Does anyone else still have this problem? I tried everything listed here and nothing works. XCode still tries to build RNInvitations even thought they were removed in RN Firebase 5.5.0:
https://rnfirebase.io/docs/v5.x.x/releases/v5.5.x#5.5.0

I no longer have this problem, and it does not show up in clean builds (CI, my rnfbdemo github repo, the test project here etc). Sorry

Also had this problem. Doing an Xcode clean (Cmd+K) and deleting the ios/build/ folder worked for me

@pbassut you may like the react-native-clean-project package, it doesn't just clean the build folder but cleans some secret-ish Xcode folders ("DerivedData") that can trip you up when you least expect it - after you already thought you cleaned Xcode out (as happened to others here).

yeah. I checked it out when you mentioned it above. It looks very useful since I immediately blame derivedData and alike when my build acts funny.
What held me back was it's popularity though :D
But I'll take a look.

I think it's mostly that people just don't know about it :-). I've personally sent a couple PRs to it though, the maintainer is solid and the code is fine on personal inspection. So now I sell it to everyone - it's always my first step for "my build broke" personally or anyone that asks, and has a pretty high success rate. Cheers!

npx react-native clean-project-auto

i did that then my project was broken yet, thank you so much

Was this page helpful?
0 / 5 - 0 ratings