xcode ['Firebase/Firebase.h' 文件未找到]我的应用程序在模拟器上运行,但在我的 iphone 6 plus 上不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36518281/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:42:39  来源:igfitidea点击:

['Firebase/Firebase.h' file not found]My app work on simulator but it doesn't work on my iphone 6 plus

xcodeswiftfirebase

提问by Yunyuen Chan

when I use simulator to run my code, it finely works. However, when it run on my iphone 6 plus the fellowing errors occur.

当我使用模拟器运行我的代码时,它运行良好。但是,当它在我的 iphone 6 上运行时,会出现访问错误。

enter image description here

在此处输入图片说明

Also these two file turn red.

这两个文件也变红了。

enter image description here

在此处输入图片说明

ps.:I use Xcode 7.3 and 'Firebase', '>= 2.5.1'. All of these are latest version.

ps.:我使用 Xcode 7.3 和“Firebase”,“>= 2.5.1”。所有这些都是最新版本。

回答by Cocoadelica

Make sure you have the library linked as well as imported:

确保您已链接和导入库:

  • Go to the project file list in the left of Xcode and select the project.
  • Select the Target.
  • In the 'General' section scroll down to 'Linked Frameworks and Libraries'
  • Check if Firebase SDK is listed, if not click '+' and add it.
  • 转到Xcode左侧的项目文件列表并选择项目。
  • 选择目标。
  • 在“常规”部分向下滚动到“链接的框架和库”
  • 检查 Firebase SDK 是否列出,如果没有,请单击“+”并添加它。

回答by Madhurya Gandi

Firebase might've not been installed in your project. Make sure you install it. Here's a link to the firebase docs.

您的项目中可能尚未安装 Firebase。确保你安装它。这是 firebase 文档的链接。

回答by ehacinom

I've found that including the library as a pod install directly helps dynamic libraries. For example, for Firebase:

我发现将库包含为 pod install 直接有助于动态库。例如,对于 Firebase:

pod 'RNFirebase', :path => 'path/to/node_modules/react-native-firebase/ios'

Changing or hardcoding HEADER_SEARCH_PATHSdid not help me.

更改或硬编码HEADER_SEARCH_PATHS对我没有帮助。

If the error ever recurs, it's not necessary to rm -rf node_modulesnor delete the pod file etc - I found it useful to clear the cache.

如果错误再次出现,则无需rm -rf node_modules删除 pod 文件等 - 我发现清除缓存很有用。

For react-native, I run

对于本机反应,我运行

    rm -rf $TMPDIR/react-native-packager-cache-*
    rm -rf $TMPDIR/metro-bundler-cache-*
    rm -rf $TMPDIR/metro-* 
    rm -rf $TMPDIR/react-* 
    rm -rf $TMPDIR/haste-*
    rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
    npm start -- --reset-cache

For Xcode I remove folders in ~/Library/Developer/Xcode/DerivedData

对于 Xcode,我删除了文件夹 ~/Library/Developer/Xcode/DerivedData