Xcode15 build 开源项目 Mattermost 报'openssl/opensslv.h' file not found 错误,求解决方法,谢谢

41 天前
 recordnow

最近工作中有用到 Mattermost 这款开源的 IM ,想本机跑一下这个项目,结果在 Xcode build 项目的 ios 部分时,报错:Flipper-Folly/folly/portability/OpenSSL.h:26:10 'openssl/opensslv.h' file not found ,请问下大家如何解决这个问题,谢谢大家,这个问题困扰好多天

环境配置,严格按照项目所需的版本进行安装:

Mac OS: Ventura 13.6.6

Xcode: 15.2 (15C500b)

Watchan: 2024.03.25.00

CocoaPods: 1.14.3

nvm: 0.39.7

node: 18.17.1

npm: 9.6.7

rvm: 1.29.12

ruby: 3.0.6p216

gem: 3.2.33

Openssl: openssl@1.1 / openssl@3 ,系统默认使用的 openssl@3

从 GitHub 下载最新的 Mattermost-mobile 工程到本机, 进入 mattermost-mobile-main ,执行 npm install 后,输出内容摘抄部分如下:

./scripts/preinstall.sh && npx solidarity

✔︎ Solidarity checks valid

mattermost-mobile@2.15.0 pod-install

cd ios && pod install

Downloading dependencies

Generating Pods project

Setting REACT_NATIVE build settings

Setting CLANG_CXX_LANGUAGE_STANDARD to c++17 on mattermost/mattermost-mobile-main/ios/Mattermost.xcodeproj

Pod install took 25 [s] to run

Patching Alamofire to include X-Uncompressed-Content-Length to measure download progress

Integrating client project

Pod installation complete! There are 108 dependencies from the Podfile and 109 total pods installed.

Configuring Compass Icons font

Generating app assets

mattermost-mobile@2.15.0 prepare

husky install

fatal: not a git repository (or any of the parent directories): .git husky - git command not found, skipping install

added 1739 packages, and audited 1740 packages in 14m

在 Xcode 中打开 mattermost-mobile-main/ios ,并在 targets 下的 Mattermost —Signing&Capabilities 中配置了开发者账号和 Bundle Identifier 和 App Groups 等信息,然后 build 项目,报错:

mattermost-mobile-main/ios/Pods/Flipper-Folly/folly/portability/OpenSSL.h:26:10 'openssl/opensslv.h' file not found ,

就是 Fipper-Folly 在 mattermost-mobile-main/ios/Pods/Flipper-Folly/folly/io/async/ssl/SSLErrors.cpp 中引入了#include <folly/portability/OpenSSL.h>,

OpenSSL.h 中进一步 #include <openssl/opensslv.h>,然后没有找到 openssl/opensslv.h 而报错。

项目里 pod 'OpenSSL-Universal',应该是能解决引用 openssl 头的问题,OpenSSL-Universal 要求在 Xcode 中使用开发者签名证书进行签名(完成了这个配置),或者启用 Disable Library Validation 权限(在 Xcode15 里找不到这个配置)

我也试过在 Fipper-Folly 这个 pod 中的 Header Search Paths 配置了"$(PODS_ROOT)/OpenSSL-Universal",也并没有用

大家的项目在 Xcode 中对于使用了 openssl 是如何解决 include openssl 找不到头文件问题的,麻烦指点下,谢谢大家

842 次点击
所在节点    Xcode
1 条回复
playtomandjerry
41 天前
pod 'OpenSSL-Universal', 然后在 xcode 中找到这个库的 target , 然后在 signing&capabilities 这里,选择 team 为你的团队,xcode 自动跑剩下的证书注册六层,然后再试着 build

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1027825

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX