0

I am creating an app with Xamarim.Forms. I need to use a native library named Unblu. I have the native Objective C framework, but I cannot create the bindings with sharpie because of those errors :

Parsing 1 header files...
While building module 'UnbluVisitorSDK' imported from /private/var/folders/sb/_lrwpl2j7sn5r5tbdhpc_kk40000gp/T/com.xamarin.ObjectiveSharpie/68a590b92ee147c08da023ee285457c4.h:1:
While building module 'UnbluCoreSDK' imported from /Users/max/Unblu/UnbluVisitorSDK.framework/Headers/UnbluVisitorSDK.h:10:
In file included from <module-includes>:1:
In file included from /Users/max/Unblu/UnbluCoreSDK.framework/Headers/UnbluCoreSDK.h:19:
/Users/max/Unblu/UnbluCoreSDK.framework/Headers/OTDefaultAudioDevice.h:8:9: fatal error: 'OpenTok/OpenTok.h' file not found
#import <OpenTok/OpenTok.h>
        ^~~~~~~~~~~~~~~~~~~
While building module 'UnbluVisitorSDK' imported from /private/var/folders/sb/_lrwpl2j7sn5r5tbdhpc_kk40000gp/T/com.xamarin.ObjectiveSharpie/68a590b92ee147c08da023ee285457c4.h:1:
In file included from <module-includes>:1:
/Users/max/Unblu/UnbluVisitorSDK.framework/Headers/UnbluVisitorSDK.h:10:9: fatal error: could not build module 'UnbluCoreSDK'
#import <UnbluCoreSDK/UnbluCoreSDK.h>
 ~~~~~~~^
/private/var/folders/sb/_lrwpl2j7sn5r5tbdhpc_kk40000gp/T/com.xamarin.ObjectiveSharpie/68a590b92ee147c08da023ee285457c4.h:1:9: fatal error: could not build module 'UnbluVisitorSDK'
@import UnbluVisitorSDK;
 ~~~~~~~^~~~~~~~~~~~~~~

Binding...
3 errors generated.
Error while processing /private/var/folders/sb/_lrwpl2j7sn5r5tbdhpc_kk40000gp/T/com.xamarin.ObjectiveSharpie/68a590b92ee147c08da023ee285457c4.h.

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

I have downloaded the OpenTok framework and tried to bind it (it works fine). Then I tries those command lines with Sharpie to bind Unblu but I still have the same errors...

sharpie bind --sdk=iphoneos --output="Unblu/UnbluCoreSDK.framework/XamarinApiDef" --namespace="UnbluCoreSDK" --framework "Unblu/UnbluCoreSDK.framework" -c -F"Downloads/OpenTok-iOS/OpenTok.framework"
sharpie bind --sdk=iphoneos --output="Unblu/UnbluCoreSDK.framework/XamarinApiDef" --namespace="UnbluCoreSDK" --framework "./Unblu/UnbluCoreSDK.framework" -c -I"Downloads/OpenTok-iOS/OpenTok.framework/Headers"

Any idea to solve this import error please ? I have the dependancy framework it is annoying to be stuck like that for days.

Maxime Esprit
  • 705
  • 1
  • 8
  • 29
  • Sharpie doesn't bind swift. So you probably need to make your own light weight objective-c wrapper around the code you want to expose. But also looks like you are missing some dependencies? – Cheesebaron Jun 23 '21 at 08:12
  • Thank you @Cheesebaron ! The two dependancies are in the framework, the UnbluCoreSDK.h is the umbrella header file and is in the framework I want to bind. The OpenTok.h is the umbrella header file of the OpenTok framework. I don't understand why it cannot import them. – Maxime Esprit Jun 23 '21 at 08:18
  • Can't understand. With the following command, it works : `sharpie bind -framework Unblu/UnbluCoreSDK.framework -sdk iphoneos`. Note that I had to copy the OpenTok.framework in the same folder of UnbluCoreSDK.framework. I also binded it, but I am not sure it was necessary. – Maxime Esprit Jun 23 '21 at 09:16

0 Answers0