react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

Build fails with error: library not found for -lFirebaseCore 🔥

Open chef-sudo opened this issue 8 years ago • 7 comments

Issue

Hello, I have a problem building my app on ios platform. Please note on the android it works fine.

So I followed successfully the ios setup but when I build with xcode 10, I'm getting ld: library not found for -lFirebaseCore Same issue as this for debug and release. I've tried changing to Legacy Build System as described, changed also the Build location to custom paths.

The full message: Ld build/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp normal x86_64 cd /Users/zero/Workspace/MyApp-mobile-app/ios export IPHONEOS_DEPLOYMENT_TARGET=11.4 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.0.sdk -L/Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator -F/Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator -F/Users/zero/Workspace/MyApp-mobile-app/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/zero/Workspace/MyApp-mobile-app/ios/Pods/FirebaseInstanceID/Frameworks -F/Users/zero/Workspace/MyApp-mobile-app/ios/Pods/GoogleAppMeasurement/Frameworks -F/Users/zero/Workspace/MyApp-mobile-app/ios -filelist /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MyApp.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=11.4 -Xlinker -object_path_lto -Xlinker /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MyApp_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lFirebaseCore -lGoogleUtilities -lc++ -lnanopb -lsqlite3 -lz -framework FIRAnalyticsConnector -framework FirebaseAnalytics -framework FirebaseCoreDiagnostics -framework FirebaseInstanceID -framework Foundation -framework GoogleAppMeasurement -framework Security -framework StoreKit -framework SystemConfiguration -ObjC -lc++ -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp.app-Simulated.xcent /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libRCTBlob.a /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libRCTAnimation.a /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libReact.a /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libRCTGeolocation.a /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libRCTImage.a /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libRCTLinking.a /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libRCTNetwork.a /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libRCTSettings.a /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libRCTText.a /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libRCTVibration.a /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a -lCodePush -lRNI18n -lRNVectorIcons -lRNFetchBlob -lc++ -lRNBackgroundTimer -lAirMaps -lRNDeviceInfo -lPods-MyApp -Xlinker -dependency_info -Xlinker /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MyApp_dependency_info.dat -o /Users/zero/Workspace/MyApp-mobile-app/ios/build/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp

ld: library not found for -lFirebaseCore clang: error: linker command failed with exit code 1 (use -v to see invocation)


Project Files

iOS

ios/Podfile:

  • [ ] I'm not using Pods
  • [x] I'm using Pods and my Podfile looks like:

platform :ios, '11.4' target 'MyApp' do pod 'Firebase/Core' end

AppDelegate.m:

#import "AppDelegate.h"
#import <CodePush/CodePush.h>

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

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation;
  
  #ifdef DEBUG
      jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
  #else
      // jsCodeLocation = [CodePush bundleURL];
      jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  #endif

  [FIRApp configure];
  
  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"MyApp"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];
  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;
}

@end

Android

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->

Environment

  • Platform that you're experiencing the issue on:
    • [x] iOS
    • [ ] Android
    • [ ] iOS but have not tested behavior on Android
    • [ ] Android but have not tested behavior on iOS
    • [ ] Both
  • If known, the version of the platform are you experiencing the issue on:
    • iOS 11.4 or iOS 9.0 e.g. iOS 10 or Android API 28
  • Operating System:
    • [x] MacOS, version: N/A
    • [ ] Windows, version: N/A
    • [ ] Other, please specify: N/A
  • Build Tools:
    • Xcode 10 e.g. Xcode 10, Android Studio 3.2
  • React Native version:
    • 0.57.4
  • React Native Firebase library version:
    • 5.0.0
  • Firebase module(s) you're using that has the issue:
    • [x] N/A
    • [ ] Authentication
    • [x] Analytics
    • [ ] Cloud Firestore
    • [ ] Cloud Messaging (FCM)
    • [ ] Crashlytics
    • [ ] Dynamic Links
    • [ ] Functions Callable
    • [ ] Invites
    • [ ] Instance ID
    • [ ] Notifications
    • [ ] Performance Monitoring
    • [ ] Realtime Database
    • [ ] Remote Config
    • [ ] Storage
  • Are you using TypeScript?
    • [ ] No
    • [x] Yes, version: 3.1.5
  • Are you using Expo, e.g. ExpoKit?
    • [x] No
    • [ ] Yes, I've not ejected
    • [ ] Yes, but I have ejected to ExpoKit
    • [ ] Yes, but I have ejected to vanilla React Native
    • Expo version: N/A

Think react-native-firebase is great? Please consider supporting the project with any of the below:

chef-sudo avatar Nov 02 '18 11:11 chef-sudo

Seems that I messed something inside the /ios, that's why it wasn't building.. I'm using the ignite boilerplate for my project and I regenerated the project and then replaced the ios/ folder with my actual, re-linked everything and now it's working fine.

chef-sudo avatar Nov 02 '18 16:11 chef-sudo

hey @mkchx I'm facing the same issue with my ionic app. Can you tell what fixes worked for you in that /ios folder? Thanks

darshanakkhichi avatar Nov 21 '18 15:11 darshanakkhichi

Anyone know the steps to fix this? i faced this issue also.

yongloon avatar Feb 10 '19 11:02 yongloon

Did you install the library for iOS correctly? Guid -> https://github.com/invertase/react-native-firebase-docs/blob/master/docs/installation/ios.md What's in your pod file?

chef-sudo avatar Feb 12 '19 13:02 chef-sudo

Pod update works Thanks

iparshantnagpal avatar May 13 '19 07:05 iparshantnagpal

I'm facing this too , it is only failing in release , related to https://github.com/invertase/react-native-firebase/issues/1563 . pod update , reinstalling and cleaning haven't worked.

sattaman avatar May 28 '19 07:05 sattaman

@sattaman this is a closed issue, please open a new issue if you have problems, following the provided template, so others can help. Note that the current instructions do not work well for me when integrating react-native-firebase v5.x.x, but I have a partial solution while I work with the maintainers on a full fix, visible here #2163

mikehardy avatar May 28 '19 14:05 mikehardy