【问题标题】:fatal error: 'React/RCTBridgeDelegate.h' file not found #import <React/RCTBridgeDelegate.h>致命错误:找不到“React/RCTBridgeDelegate.h”文件#import <React/RCTBridgeDelegate.h>
【发布时间】:2021-07-23 17:22:58
【问题描述】:

这是适用于 ios 的 react-native 应用程序,我想通过使用 firebase 的推送通知来改进它。但是当我通过命令“react-native run-ios”或通过 xcode 构建项目时,它会崩溃。我寻找解决方案,但回答:

( - 打开终端并进入你的项目 ios 目录

  • 输入 pod init(如果不存在),然后 pod install
  • 打开工作区项目并从 ios 文件夹中删除构建
  • 从终端运行 react-native run-ios。) - 不适用于我的项目,我也尝试了命令“pod update”,但也没有帮助。

我附上了两个文件Podfile和AppDeligate.h的内容,可能是它们的问题。

#Podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'

target 'appName' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'

  pod 'RNFBMessaging', :path => '../node_modules/@react-native-firebase/messaging'

  target 'appNameTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'appName-tvOS' do
  # Pods for appName-tvOS

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

##AppDeligate.h

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

@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>

@property (nonatomic, strong) UIWindow *window;

@end

【问题讨论】:

    标签: ios react-native xcode11 firebase-notifications


    【解决方案1】:

    您的 podfile 部署目标是 10.0,您能否验证这是否与 Xcode 项目中设置的目标相同。有时,由于部署目标不匹配,我们会遇到此问题。

    【讨论】:

    • .xcodeproj -> 常规 -> 部署信息 -> IOS 10.0 iPhone。如果你是认真的。
    猜你喜欢
    • 2019-12-08
    • 2023-03-08
    • 2023-01-05
    • 1970-01-01
    • 1970-01-01
    • 2022-01-03
    • 2021-09-04
    • 1970-01-01
    • 2021-05-24
    相关资源
    最近更新 更多