1

I am attempting to create a binding project for the StripeTerminal CocoaPod (Stripe Terminal iOS). I setup the pod file. Then using the Xamarin docs, I installed Objective Sharpie, and used

sharpie pod bind

which created two files. StripeTerminal_ApiDefinitions.cs and StripeTerminal_StructsAndEnums.cs. Those files look good and have the methods I am expecting when I was using a XCode project.

I then pointed added a Native Reference to the StripeTerminal framework file, but it seems a link file was not created. The Xamarin help documentions mention that a iOS Native Library ends in .a, while this framework does not. I tried pointing the native reference to the folder of the framework, to the extensionless library, and even renamed the library project to .a. Each time when I attempt to build it gives me an error of "No API definition file specified".

tarrball
  • 2,123
  • 3
  • 23
  • 34
Josh
  • 2,248
  • 2
  • 19
  • 38
  • Yes, both files were added then I added the Native Reference. Next build it gave the No API definition file specified error. – Josh May 27 '19 at 01:50
  • Looks like they are on Compile at the moment. What should the two .cs files be set to for their build action? – Josh May 27 '19 at 01:57

1 Answers1

3

Your API definition file(s) should have a build action of ObjcBindingApiDefinition:

<ItemGroup>
    <ObjcBindingApiDefinition Include="ApiDefinition.cs" />
</ItemGroup>

And your Enum|Structs file(s) should have a build action of ObjcBindingCoreSource:

<ItemGroup>
    <ObjcBindingCoreSource Include="Structs.cs" />
</ItemGroup>
SushiHangover
  • 73,120
  • 10
  • 106
  • 165