V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
recordnow
V2EX  ›  Xcode

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

  •  
  •   recordnow · 30 天前 · 795 次点击

    最近工作中有用到 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: [email protected] / openssl@3 ,系统默认使用的 openssl@3

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

    ./scripts/preinstall.sh && npx solidarity

    ✔︎ Solidarity checks valid

    [email protected] 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

    [email protected] 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 找不到头文件问题的,麻烦指点下,谢谢大家

    1 条回复    2024-03-28 17:15:36 +08:00
    playtomandjerry
        1
    playtomandjerry  
       30 天前
    pod 'OpenSSL-Universal', 然后在 xcode 中找到这个库的 target , 然后在 signing&capabilities 这里,选择 team 为你的团队,xcode 自动跑剩下的证书注册六层,然后再试着 build
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2905 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 12:35 · PVG 20:35 · LAX 05:35 · JFK 08:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.