alexsorokoletov / objc-automatic

[Not supported anymore] Automation tool to bind CocoaPods to NuGet packages for Xamarin.iOS
45 stars 15 forks source link

PayPalHere Binding #13

Open kodejack opened 6 years ago

kodejack commented 6 years ago

Hi,

I'm trying to bind the PayPalHere cocoa pod and hitting a number of issue. I get further when trying to bind it with objective sharpie directly as this seems generate the ApiDenfintion and Structs but then throw an exceptions after this part complete.

https://cocoapods.org/pods/PayPalHereSDKv2 sharpie pod init ios PayPalHereSDKv2/Release sharpie pod bind

Exception exception.txt

Should I be able to bind this using objc-automatic?

kodejack commented 6 years ago

Ok so made some progress with the Objective sharpie pod bin exception.

System.TypeInitializationException: The type initializer for 'Mono.Unix.Native.Syscall' threw an exception. ---> System.DllNotFoundException: /Library/Frameworks/ObjectiveSharpie.framework/Versions/3.4.0/../lib/libMonoPosixHelper.dylib

As this suggest it is looking for the libMonoPosixHelper.dylib. which is not in the parent folder of ObjectiveSharpie.framework/Versions/3.4.0, it is inside the folder this directory.

So the work-around was to copy the files to location Sharpie is expecting and it stopped throwing the exception and I could move on with my binding.

I have hit the next issue which is cause badly formed frameworks and umbrella headers not being present but I will try and work round this ATM.

alexsorokoletov commented 6 years ago

@kodejack Gordon, thank you for opening this thread. Looks like your Sharpie installation was corrupt. Did you try reinstalling it?

Just to clarify, the exception you attached in the first comment is coming from Xamarin's sharpie tool. Wondering if you tried to bind the same cocoapod using objc-automatic. It should work that through.

I have hit the next issue

Would you be kind to elaborate?

kodejack commented 6 years ago

@alexsorokoletov Hi Alex,

No I did not try reinstalling it but I will do that now.

Yes I did try using objc-automatic but I didn't get as far as I did with sharpie pod bind.

The next issue was binding the other libraries that main SDK was dependant on.

PPHR_BLE.framework PPHSDK_BLE.framework PPHSwiper.framework

To update you on progress I have a working binding now! After manipulating the other libraries to add a valid umbrella header and correcting some of the import paths and casing, I got it working.

The only other issue I hit was that one of other libraries (PPHSDK_BLE.framework) was built using the iphoneOS 10.3 SDK, (everything else was using 11.2) which throw an error. However, the binding for what I need is working without this library being bound.

alexsorokoletov commented 6 years ago

Do you need help with specifying iphone sdk you want to use for bindings?

alexsorokoletov commented 6 years ago

And also - thank you for the update on your progress! I really appreciate sharing details how is the journey for you since my scenarios are bit different. This is very useful information

kodejack commented 6 years ago

Hi Alex, I know how to deal with the iphoheOS SDKs when I'm binding libs individually but this was as part of the sharpie pod bind and only one lib was different. Also, I don't have the old 10.3 SDKs installed on my machine. In this case, I changed the Info.plist to work around this issue.

Is there another way to do this? I would be really interested to know if you were able to use objc-automatic to bind this without any issues? As I have had to do a good number workarounds. I'm happy to share these if needed.

alexsorokoletov commented 6 years ago

You can always install older SDKs from XCode preferences.

Regarding bindings, right now with cocoapods 1.4.0 it fails on the following step:

ld: '/Users/alex/work/dt/objc-automatic/pods/PayPalHereSDKv2.Release/XCode/Pods/PayPalHereSDKv2/RSDK/Release/PayPalRetailSDK.framework/PayPalRetailSDK' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/alex/work/dt/objc-automatic/pods/PayPalHereSDKv2.Release/XCode/Pods/PayPalHereSDKv2/RSDK/Release/PayPalRetailSDK.framework/PayPalRetailSDK' for architecture arm64

I guess the template objc-automatic uses for XCode to compile binaries has bitcode enabled while this pod does not contain bitcode.

b099l3 commented 5 years ago

We ended up binding this manually so this issue can be closed