无法为 FBSDKShareKit cocoapod 创建 objective sharpie 绑定

Failing to create objective sharpie bindings for FBSDKShareKit cocoapod

我正在尝试为 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

似乎有些参考文献 resolved/copied 不正确。 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
    • 绑定现在按预期工作。万岁!