首页 > 解决方案 > 在 iOS 上原生找不到 RNFirebase 核心模块

问题描述

AppDelegate.m

#import "Firebase.h"
#import "AppDelegate.h"

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

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [FIRApp configure];
  NSURL *jsCodeLocation;

  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"kakashi"
                                               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

播客文件:

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

target 'my_app' do
  pod 'Firebase/Core'

end

已验证Build phase/Link Binary with Libraries具有 libRNFirebase.a

我还验证了$(inherited)是否存在框架搜索路径。

仍然出现RNFirebase core module was not found natively on iOS错误expo startnpm start

你能推荐如何解决这个问题吗?或任何有关验证/确保其工作的帮助都非常感谢。

标签: iosreact-nativereact-native-iosreact-native-firebase

解决方案


推荐阅读