Failing to create objective sharpie bindings for FBSDKShareKit cocoapod

398 Views Asked by At

I am trying to recreate the bindings for the cocoapod FBSDKShareKit.

I executed:

sharpie pod init ios FBSDKShareKit
sharpie pod bind

The error i am getting:

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

Seems like some reference is not resolved/copied properly. Google told me nothing about this issue (or i asked the wrong questions).

Have someone seen this error in the past, or even know a solution?

1

There are 1 best solutions below

0
On BEST ANSWER

Found a workaround with inspiration by dalexsoto (Discord DotNetEvolution):

  1. sudo gem uninstall cocoapods && sudo gem install cocoapods -v 1.5.0
    • Newest version of cocoapods is not compatible with the most recent version of objective sharpie.
  2. sharpie pod init ios FBSDKShareKit
    • Just the regular download & preparation.
  3. sharpie pod bind (fails)
    • The first bind attempt fails, but creates all the files necessary.
  4. cp -r ./build/Release-maccatalyst/FBSDKCoreKit/* ./build/Release-maccatalyst/FBSDKShareKit/
    • Copies the build artifacts of FBSDKCoreKit to the build target folder of FBSDKShareKit. This satisfies the references between the Facebook sdk header files.
  5. sharpie pod bind
    • Binding is now working as expected. Hooray!