无法为 FBSDKShareKit cocoapod 创建客观的Sharpie 绑定

问题描述

我正在尝试为 cocoapod FBSDKShareKit 重新创建绑定。

我执行了:

sharpie pod init ios FBSDKShareKit
sharpie pod bind

我得到的错误

While building module 'FBSDKShareKit' imported from /private/var/folders/something.h:1:
In file included from <module-includes>:1:
In file included from /Users/something/ShareKit/build/Release-maccatalyst/FBSDKShareKit/FBSDKShareKit.framework/Headers/FBSDKShareKit-umbrella.h:13:
In file included from /Users/something/ShareKit/build/Release-maccatalyst/FBSDKShareKit/FBSDKShareKit.framework/Headers/FBSDKAppGroupContent.h:30:
/Users/something/ShareKit/build/Release-maccatalyst/FBSDKShareKit/FBSDKShareKit.framework/Headers/FBSDKCoreKitImport.h:29:10: Fatal error: 
      'FBSDKCoreKit/FBSDKCoreKit.h' file not found
 #import <FBSDKCoreKit/FBSDKCoreKit.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/private/var/folders/something.h:1:9: Fatal error: Could not build module 'FBSDKShareKit'
@import FBSDKShareKit;
 ~~~~~~~^~~~~~~~~~~~~

Binding...
2 errors generated.
Error while processing /private/var/folders/something.h.

Done. Exiting with error code 1.
error: Clang Failed to parse input and exited with code 1

似乎某些参考没有正确解析/复制。 Google 没有告诉我这个问题(或者我问错了问题)。

过去有人见过这个错误,甚至知道解决方案吗?

解决方法

在 dalexsoto (Discord DotNetEvolution) 的启发下找到了一个解决方法:

  1. sudo gem uninstall cocoapods && sudo gem install cocoapods -v 1.5.0
    • 最新版本的 cocoapods 与最新版本的 Objective Sharpie 不兼容。
  2. sharpie pod init ios FBSDKShareKit
    • 只需定期下载和准备即可。
  3. sharpie pod bind(失败)
    • 第一次绑定尝试失败,但会创建所有必需的文件。
  4. cp -r ./build/Release-maccatalyst/FBSDKCoreKit/* ./build/Release-maccatalyst/FBSDKShareKit/
    • 将 FBSDKCoreKit 的构建工件复制到 FBSDKShareKit 的构建目标文件夹。这满足 Facebook sdk 头文件之间的引用。
  5. sharpie pod bind
    • 绑定现在按预期工作。万岁!

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...