0

我正在尝试重新创建 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

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

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

4

1 回答 1

0

在 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
    • 绑定现在按预期工作。万岁!
于 2021-02-12T13:17:58.990 回答