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

🔥 Undefined symbols for architecture x86_64 & Use of undefined identifier

Open mycob opened this issue 8 years ago • 5 comments

Issue

First, I really appreciate RNF's existence and I want to thank anyone and everyone who is willing to help...

I have successfully implemented RNF using RNFirebaseNotification, RNFirebaseMessaging and RNFirebaseAnalytics. It has worked flawlessly. This week, I was in the process of implementing authentication and storage. I went through the same process of MANUALLY installing frameworks WITHOUT COCOAPODS using this process as I have in the past. The implementation of RNFirebaseAuth went without any issues--binary compiled without a problem as well as debugging with both simulator and actual device...

MY PROBLEM is when I add the RNFirebaseStorage framework. As soon as the framework is added (process done the same as all other frameworks that were successfully implemented), the binary will no longer compile with a slew of errors. See images below:

THIS IS THE INITIAL ERRORS THAT I GET... screen shot 2018-10-28 at 9 21 50 am

FOLDER STRUCTURE WHERE ISSUE OCCURS screen shot 2018-10-28 at 4 36 23 pm

HEADER SEARCH PATHS (ALL HAVE BEEN WORKING BEFORE FRAMEWORK IS ADDED) screen shot 2018-10-28 at 4 43 17 pm

THESE ERRORS OCCUR AFTER I UNLINK AND RELINK RNF screen shot 2018-10-28 at 8 09 09 am

I have tried solutions proposed doing the following: add libsqlite3.tbd, libz.tbd, libc++.tbd in Linked Frameworks as well as REMOVING DERIVED DATA found here. I also tried different configurations described here.

I have also unlinked and re-linked react-native-firebase.

Again, I have successfully installed and implemented RNF until I add the RNFirebaseStorage framework.

I appreciate all the help.

Thank you in advance.


Project Files

iOS

ios/Podfile:

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

AppDelegate.m:


#import "Firebase.h"
#import "RNFirebaseNotifications.h"
#import "RNFirebaseMessaging.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTPushNotificationManager.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation;
  // firebase config
  [FIRApp configure];
  // notifications config
  [RNFirebaseNotifications configure];
  
#if DEBUG
 jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
 jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
  

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"someApp"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];
  rootView.backgroundC

olor = [[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;
}

  - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
    [[RNFirebaseNotifications instance] didReceiveLocalNotification:notification];
  }

  - (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
  fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
    [[RNFirebaseNotifications instance] didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
  }

  - (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
    [[RNFirebaseMessaging instance] didRegisterUserNotificationSettings:notificationSettings];
  }

@end
// N/A

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
    • [x] 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 10 e.g. iOS 10 or Android API 28
  • Operating System:
    • [ x] MacOS, version: High Sierra
    • [ ] 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.55.2
  • React Native Firebase library version:
    • ^4.3.7
  • Firebase module(s) you're using that has the issue:
    • [ ] N/A
    • [ ] Authentication
    • [ ] Analytics
    • [ ] Cloud Firestore
    • [ ] Cloud Messaging (FCM)
    • [ ] Crashlytics
    • [ ] Dynamic Links
    • [ ] Functions Callable
    • [ ] Invites
    • [ ] Instance ID
    • [ ] Notifications
    • [ ] Performance Monitoring
    • [ ] Realtime Database
    • [ ] Remote Config
    • [ x] Storage
  • Are you using TypeScript?
    • [x ] No
    • [ ] Yes, version: N/A
  • 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

mycob avatar Oct 28 '18 21:10 mycob

Has anyone successfully implemented FirebaseStorage installing it manually as mentioned above? It is the only component that is not working for me.

mycob avatar Dec 02 '18 14:12 mycob

Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 30 '18 14:12 stale[bot]

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

stale[bot] avatar Jan 13 '19 14:01 stale[bot]

If you've imported the RNFirebase.xcodeproj into your Libraries folder then you can click on it and make sure RNFirebase is selected under TARGETS, go to Build Settings and search for "other linker flags", double click the field and add -ObjC. I had similar issues with undefined symbols and this seemed to be the only thing that fixed it.

JMV2112 avatar Jan 23 '19 22:01 JMV2112

any one able to solve this yet?

salmanbukhari1 avatar Apr 15 '19 09:04 salmanbukhari1