objc-automatic icon indicating copy to clipboard operation
objc-automatic copied to clipboard

PayPalHere Binding

Open kodejack opened this issue 6 years ago • 8 comments

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 avatar Mar 13 '18 16:03 kodejack

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.

kodejack avatar Mar 14 '18 12:03 kodejack

@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?

alexsorokoletov avatar Mar 19 '18 14:03 alexsorokoletov

@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.

kodejack avatar Mar 29 '18 16:03 kodejack

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

alexsorokoletov avatar Mar 29 '18 17:03 alexsorokoletov

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

alexsorokoletov avatar Mar 29 '18 17:03 alexsorokoletov

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.

kodejack avatar Mar 30 '18 16:03 kodejack

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.

alexsorokoletov avatar Apr 12 '18 15:04 alexsorokoletov

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

b099l3 avatar Sep 28 '18 11:09 b099l3