Sharpie Issues with Objective-c binding in Xamarin

Hi I'm trying to include static library in binding project.

For that first i create libtob_browser.a( static file of my ios app),I aded this file in Native Reference in Xamarin for which i need to create objective sharpie api definition.

I installed objective sharpie, then I tried to get objective sharpie api definitions for ApiDefinition.cs and structs.cs . Following this link Xamarin Official website I applied folloing command to build objective sharpie api definition

sharpie bind -output Tob -namespace Tob_Browser -sdk iphoneos8.1 /Xamarin/users/hiddenreflex/Desktop/Tob_Browser/Tob_Browser.h

I got stuck with this

[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Sharpie.Tooling.Tool+ExitException: Exception of type 'Sharpie.Tooling.Tool+ExitException' was thrown.
at Sharpie.ParseTool+ParseOptionSection.SetTargetSdk (System.String sdkIdentifier) <0x10b3f72e0 + 0x00176> in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x10b3f6650 + 0x000bb> in :0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x10b3f6650 + 0x00139> in :0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) <0x10b3f72a0 + 0x0002a> in :0
at Sharpie.Tooling.ReflectionBoundOption.Bind (System.String value) <0x10b3ecc80 + 0x00309> in :0
at Sharpie.Tooling.Tool.ProcessArgument () <0x10b3e3850 + 0x0058b> in :0
at Sharpie.ParseTool.ProcessArgument () <0x10b3eab50 + 0x00086> in :0
at Sharpie.Tooling.Tool.ProcessArguments () <0x10b3e37d0 + 0x0002d> in :0
at Sharpie.Tooling.Tool.Run (IEnumerable1 args) <0x10b3ddcc0 + 0x00637> in <filename unknown>:0 at Sharpie.Tooling.ToolRunnerTool.Run () <0x10b3e8f80 + 0x00289> in <filename unknown>:0 at Sharpie.Entry+SharpieToolRunnerTool.Run () <0x10b3e8eb0 + 0x0002c> in <filename unknown>:0 at Sharpie.Tooling.Tool.Run (IEnumerable1 args) <0x10b3ddcc0 + 0x0064a> in :0
at Sharpie.Tooling.ToolRunnerTool.Run (IEnumerable1 args, System.Action1 aboutToRunToolHandler) <0x10b3ddc20 + 0x0005c> in :0
at Sharpie.Entry.Main (System.String[] args) <0x1079c0e60 + 0x0032b> in :0
I am new in Xamarin please help me before negate this post.

Any idea will be appreciated.

Thanks in Advance.

Answers

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    Run the following command and post back the results:

    sharpie xcode -sdks
    
  • Hello Sir

    actually i want to create objective sharpie api definition

    For that first i created libtob_browser.a( static file of my ios app),I aded this file in Native Reference in Xamarin for which i need to create objective sharpie api definition.

    I installed objective sharpie, then I tried to get objective sharpie api definitions for ApiDefinition.cs and structs.cs . Following this link https://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-c/walkthrough/#Creating_A_Static_Library I applied following command to build objective sharpie api definition

    sharpie bind -output Tob -namespace Tob_Browser -sdk iphoneos8.1 /Xamarin/users/hiddenreflex/Desktop/Tob_Browser/Tob_Browser.h

    but I got stuck with this

    one or more files cannot be found:
    /Xamarin/users/hiddenreflex/Desktop/Tob_Browser/Tob_Browser/Tob_Browser.h

    Submitting usage data to Xamarin...
    Submitted - thank you for helping to improve Objective Sharpie!

    Done. Exiting with error code 1.

    please help me sir i'm new in Xamarin.

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    That's very different from the error you showed in your first post where it failed in the call to SetTargetSDK. That's why I asked you to run the command sharpie code --sdks. That will list the set of installed sdks on your Mac. It may be that you're missing the iPhone 8.1 SDK.

    In your second post, you're getting an error referencing a header file not being found. It looks like you may be specifying the wrong path to the main header file. If you follow the example, then it should be something like:

    sharpie bind --output Tob --namespace Tob_Browser --sdk iphoneos8.1 /<full-path-to-project>/Tob_Browser/Tob_Browser/Tob_Browser.h
    

    Are you sure your user directory is /Xamarin/users/hiddenreflex? That would not be normal. User directories are normally under /Users, so I would expect yours to be in /Users/hiddenreflex. In which case, the correct command would be:

    sharpie bind --output Tob --namespace Tob_Browser --sdk iphoneos8.1 /Users/hiddenreflex/Desktop/Tob_Browser/Tob_Browser/Tob_Browser.h
    
  • Hello Guys, I am facing issue with Sharpie as well. Where shall I post a query ?

Sign In or Register to comment.