gpt4 book ai didi

ios - 构建失败 'React/RCTBridgeModule.h' 找不到文件

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:28:37 25 4
gpt4 key购买 nike

我花了一整天的时间试图解决我的问题,我尝试了在其他 SO 帖子中找到的所有解决方案,但不幸的是我无法弄清楚如何解决我的问题。

我尝试将 TouchID 集成到我的 react-native 项目中。我下载了一个名为“react-native-touch-id”的 npm 包(听起来很完美!)。我按照安装指南手动将库链接到我的项目。

但是当我尝试运行应用程序时,出现以下错误:

main problem image enter image description here

我试图清理我的项目:

  • rm -rf node_modules
  • yarn 缓存清理&& yarn 安装
  • rm -rf ios/Pods/&& pod 安装

在 xCode 中,我什至清理了构建文件夹。

关于我的版本:

  • RN:0.57.4
  • 代码:10.1
  • react-native-touch-id : 4.3.0

这是我的 Podfile :

def available_pods
pod 'TouchID', :path => "../node_modules/react-native-touch-id"
end
target 'App' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
available_pods
end

我在项目的库目录中添加了 react-native-touch-id 包的 .xcodeproj,并在构建阶段链接了它。

enter image description here enter image description here

但我仍然一次又一次地遇到同样的错误......我不明白为什么......如果有人有想法,我们将不胜感激:)

最佳答案

看来问题出在 Podfile 上。似乎 Podfile 使用它自己的 Podspec 造成了麻烦。所以我只是从我的 Podfile 中删除 TouchId pod 声明,清理并重新安装我的 pod。

然后,我手动将库链接到我的 xcode 工作区。为此,在您的项目名称下,右键单击 Libraries 目录 => 将文件添加到“您的项目名称”=> 添加位于您的 node_modules 目录中的 npm 包的 xcodeproj

之后,在您的项目Build Phases 下的Link Binary with Libraries 下,您必须添加npm 的包静态库(在我的例子中是libTouchID.a)。

为确保您可以清理项目并尝试重建,它现在应该可以工作了。

作为引用,我保留了上面提到的所有软件版本。

关于ios - 构建失败 'React/RCTBridgeModule.h' 找不到文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53541573/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com