NAXAM/stripe-ios-binding

Wrong date format in the binding?

r3econ opened this issue · 3 comments

Adding a package with version 13.1 of the SDK results in error:

The registrar found an invalid type `System.DateTime` in signature for method `StripeSdk.STPPaymentIntent.get_CanceledAt`. Use `Foundation.NSDate` instead.

The app terminates immediately, rendering the SDK useless. Is there a way to fix this?

Full error log:

Loaded assembly: /Users/rsroka/Library/Developer/CoreSimulator/Devices/FCE60162-EF0D-4507-B828-FCC140D51911/data/Containers/Bundle/Application/8E2C19D3-7E23-4A8B-882F-35346DF25840/ecarupiOS.app/Naxam.Stripe.iOS.dll [External]
2018-12-10 14:19:47.574785+0100 ecarupiOS[41286:1499047] System.AggregateException: One or more errors occurred. ---> ObjCRuntime.RuntimeException: The registrar found an invalid type `System.DateTime` in signature for method `StripeSdk.STPPaymentIntent.get_CanceledAt`. Use `Foundation.NSDate` instead.
  at Registrar.Registrar.ToSignature (System.Type type, Registrar.Registrar+ObjCMember member, System.Boolean& success, System.Boolean forProperty) [0x0037a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2542 
  at Registrar.Registrar.ComputeSignature (System.Type declaring_type, System.Boolean is_ctor, System.Type return_type, System.Type[] parameters, System.Reflection.MethodBase mi, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00035] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2436 
  at Registrar.Registrar.ComputeSignature (S
ystem.Type DeclaringType, System.Reflection.MethodBase Method, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00059] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2423 
  at Registrar.Registrar+ObjCMethod.ComputeSignature () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:882 
  at Registrar.Registrar+ObjCMethod.ValidateSignature (System.Collections.Generic.List`1[System.Exception]& exceptions) [0x00017] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:870 
   --- End of inner exception stack trace ---
---> (Inner Exception #0) ObjCRuntime.RuntimeException: The registrar found an invalid type `System.DateTime` in signature for method `StripeSdk.STPPaymentIntent.get_CanceledAt`. Use `Foundation.NSDate` instead.
  at Registrar.Registrar.ToSignature (System.Type type, Reg
istrar.Registrar+ObjCMember member, System.Boolean& success, System.Boolean forProperty) [0x0037a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2542 
  at Registrar.Registrar.ComputeSignature (System.Type declaring_type, System.Boolean is_ctor, System.Type return_type, System.Type[] parameters, System.Reflection.MethodBase mi, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00035] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2436 
  at Registrar.Registrar.ComputeSignature (System.Type DeclaringType, System.Reflection.MethodBase Method, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00059] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2423 
  at Registrar.Registrar+ObjCMethod.ComputeSignature () [0x00000] in /Li
brary/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:882 
  at Registrar.Registrar+ObjCMethod.ValidateSignature (System.Collections.Generic.List`1[System.Exception]& exceptions) [0x00017] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:870 <---

---> (Inner Exception #1) ObjCRuntime.RuntimeException: The registrar found an invalid type `System.DateTime` in signature for method `StripeSdk.STPPaymentIntent.get_created`. Use `Foundation.NSDate` instead.
  at Registrar.Registrar.ToSignature (System.Type type, Registrar.Registrar+ObjCMember member, System.Boolean& success, System.Boolean forProperty) [0x0037a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2542 
  at Registrar.Registrar.ComputeSignature (System.Type declaring_type, System.Boolean is_ctor, System.Type return_type, System.Type[] parameters, System.Reflection.MethodBase mi, Registrar.Registra
r+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00035] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2436 
  at Registrar.Registrar.ComputeSignature (System.Type DeclaringType, System.Reflection.MethodBase Method, Registrar.Registrar+ObjCMember member, System.Boolean isCategoryInstance, System.Boolean isBlockSignature) [0x00059] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2423 
  at Registrar.Registrar+ObjCMethod.ComputeSignature () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:882 
  at Registrar.Registrar+ObjCMethod.ValidateSignature (System.Collections.Generic.List`1[System.Exception]& exceptions) [0x00017] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.1.0.15/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:870 <---

Hi @r3econ, This bug is fixed in our forked repo here if you need it

I am still getting this issue. I am adding the latest package. What might I doing wrong?

@gfbriggs Please could you help me update this library ? I've made the bindings for the latest native version build correctly, but I'm facing weired errors, Here is the stackoverflow question corresponding to the errors I'm facing: https://stackoverflow.com/questions/62071960/xamarin-ios-objective-c-binding-library-could-not-create-an-native-instance-of-t?noredirect=1#comment109803217_62071960