0

Simulator Exception:

System.Exception: Could not create an native instance of the type 'TPBinding.Worldpay': the native class hasn't been loaded.

Device Exception:

ObjCRuntime.RuntimeException: Wrapper type 'TPBinding.Worldpay' is missing its native ObjectiveC class 'Worldpay'.

I have created a binding for the following Objective C lib for use in an Xmarin.Forms application via Dependency Service

https://github.com/Worldpay/worldpay-lib-ios

I have created the CocoaPods Static lib to generate and combine the necessary binaries and ultimately the fat lib for use within the Binding project. Running the following lipo & nm commands leads me to think I'm good up to this point.

Development:Products ***$ lipo -info libWorldpayStaticAll
Architectures in the fat file: libWorldpayStaticAll are: armv7 armv7s i386 x86_64 arm64 

Development:Products ***$ nm libWorldpayStaticAll

I have successfully generated the ApiDefinitions & Structs&Enums for the binding project below

using System;
using Foundation;
using ObjCRuntime;
using PassKit;
using UIKit;

namespace TPBinding
{
    // @interface APMController : UIViewController
    [BaseType(typeof(UIViewController))]
    [Protocol]
    interface APMController
    {
        // @property (nonatomic) UIView * customToolbar;
        [Export("customToolbar", ArgumentSemantic.Assign)]
        UIView CustomToolbar { get; set; }

        // @property (nonatomic) float price;
        [Export("price")]
        float Price { get; set; }

        // @property (retain, nonatomic) NSString * apmName;
        [Export("apmName", ArgumentSemantic.Retain)]
        string ApmName { get; set; }

        // @property (retain, nonatomic) NSString * customerOrderCode;
        [Export("customerOrderCode", ArgumentSemantic.Retain)]
        string CustomerOrderCode { get; set; }

        // @property (retain, nonatomic) NSString * orderDescription;
        [Export("orderDescription", ArgumentSemantic.Retain)]
        string OrderDescription { get; set; }

        // @property (retain, nonatomic) NSDictionary * customerIdentifiers;
        [Export("customerIdentifiers", ArgumentSemantic.Retain)]
        NSDictionary CustomerIdentifiers { get; set; }

        // @property (retain, nonatomic) NSString * successUrl;
        [Export("successUrl", ArgumentSemantic.Retain)]
        string SuccessUrl { get; set; }

        // @property (retain, nonatomic) NSString * failureUrl;
        [Export("failureUrl", ArgumentSemantic.Retain)]
        string FailureUrl { get; set; }

        // @property (retain, nonatomic) NSString * cancelUrl;
        [Export("cancelUrl", ArgumentSemantic.Retain)]
        string CancelUrl { get; set; }

        // @property (retain, nonatomic) NSString * pendingUrl;
        [Export("pendingUrl", ArgumentSemantic.Retain)]
        string PendingUrl { get; set; }

        // @property (retain, nonatomic) NSString * address;
        [Export("address", ArgumentSemantic.Retain)]
        string Address { get; set; }

        // @property (retain, nonatomic) NSString * city;
        [Export("city", ArgumentSemantic.Retain)]
        string City { get; set; }

        // @property (retain, nonatomic) NSString * postalCode;
        [Export("postalCode", ArgumentSemantic.Retain)]
        string PostalCode { get; set; }

        // @property (retain, nonatomic) NSString * token;
        [Export("token", ArgumentSemantic.Retain)]
        string Token { get; set; }

        // @property (retain, nonatomic) NSString * name;
        [Export("name", ArgumentSemantic.Retain)]
        string Name { get; set; }

        // @property (retain, nonatomic) NSString * currencyCode;
        [Export("currencyCode", ArgumentSemantic.Retain)]
        string CurrencyCode { get; set; }

        // @property (retain, nonatomic) NSString * settlementCurrency;
        [Export("settlementCurrency", ArgumentSemantic.Retain)]
        string SettlementCurrency { get; set; }

        // @property (retain, nonatomic) NSString * countryCode;
        [Export("countryCode", ArgumentSemantic.Retain)]
        string CountryCode { get; set; }

        // -(void)setAuthorizeAPMOrderBlockWithSuccess:(authorizeAPMOrderSuccess)success failure:(authorizeAPMOrderFailure)failure;
        [Export("setAuthorizeAPMOrderBlockWithSuccess:failure:")]
        void SetAuthorizeAPMOrderBlockWithSuccess(authorizeAPMOrderSuccess success, authorizeAPMOrderFailure failure);
    }

    // typedef void (^authorizeAPMOrderSuccess)(NSDictionary *);
    delegate void authorizeAPMOrderSuccess(NSDictionary arg0);

    // typedef void (^authorizeAPMOrderFailure)(NSDictionary *, NSArray *);
    delegate void authorizeAPMOrderFailure(NSDictionary arg0, NSObject[] arg1);

    // @interface ThreeDSController : UIViewController
    [BaseType(typeof(UIViewController))]
    [Protocol]
    interface ThreeDSController
    {
        // @property (nonatomic) UIView * customToolbar;
        [Export("customToolbar", ArgumentSemantic.Assign)]
        UIView CustomToolbar { get; set; }

        // @property (nonatomic) float price;
        [Export("price")]
        float Price { get; set; }

        // @property (retain, nonatomic) NSString * address;
        [Export("address", ArgumentSemantic.Retain)]
        string Address { get; set; }

        // @property (retain, nonatomic) NSString * city;
        [Export("city", ArgumentSemantic.Retain)]
        string City { get; set; }

        // @property (retain, nonatomic) NSString * postalCode;
        [Export("postalCode", ArgumentSemantic.Retain)]
        string PostalCode { get; set; }

        // @property (retain, nonatomic) NSString * token;
        [Export("token", ArgumentSemantic.Retain)]
        string Token { get; set; }

        // @property (retain, nonatomic) NSString * name;
        [Export("name", ArgumentSemantic.Retain)]
        string Name { get; set; }

        // @property (nonatomic) NSDictionary * customerIdentifiers;
        [Export("customerIdentifiers", ArgumentSemantic.Assign)]
        NSDictionary CustomerIdentifiers { get; set; }

        // -(void)setAuthorizeThreeDSOrderBlockWithSuccess:(threeDSOrderSuccess)success failure:(threeDSOrderFailure)failure;
        [Export("setAuthorizeThreeDSOrderBlockWithSuccess:failure:")]
        void SetAuthorizeThreeDSOrderBlockWithSuccess(threeDSOrderSuccess success, threeDSOrderFailure failure);
    }

    // typedef void (^threeDSOrderSuccess)(NSDictionary *);
    delegate void threeDSOrderSuccess(NSDictionary arg0);

    // typedef void (^threeDSOrderFailure)(NSDictionary *, NSArray *);
    delegate void threeDSOrderFailure(NSDictionary arg0, NSObject[] arg1);

    // @interface Worldpay : NSObject
    [BaseType(typeof(NSObject))]
    [Protocol]
    interface Worldpay
    {
        // @property (nonatomic) WorldpayValidationType validationType;
        [Export("validationType", ArgumentSemantic.Assign)]
        WorldpayValidationType ValidationType { get; set; }

        // @property (retain, nonatomic) NSString * clientKey;
        [Export("clientKey", ArgumentSemantic.Retain)]
        string ClientKey { get; set; }

        // @property (retain, nonatomic) NSString * serviceKey;
        [Export("serviceKey", ArgumentSemantic.Retain)]
        string ServiceKey { get; set; }

        // @property (nonatomic) BOOL reusable;
        [Export("reusable")]
        bool Reusable { get; set; }

        // @property (nonatomic) BOOL authorizeOnly;
        [Export("authorizeOnly")]
        bool AuthorizeOnly { get; set; }

        // @property (retain, nonatomic) NSString * tokenType;
        [Export("tokenType", ArgumentSemantic.Retain)]
        string TokenType { get; set; }

        // +(Worldpay *)sharedInstance;
        [Static]
        [Export("sharedInstance")]
        //[Verify(MethodToProperty)]
        Worldpay SharedInstance();

        // -(NSString *)APIStringURL;
        [Export("APIStringURL")]
        //[Verify(MethodToProperty)]
        string APIStringURL { get; }

        // -(void)createTokenWithNameOnCard:(NSString *)holderName cardNumber:(NSString *)cardNumber expirationMonth:(NSString *)expirationMonth expirationYear:(NSString *)expirationYear CVC:(NSString *)CVC success:(requestUpdateTokenSuccess)success failure:(requestTokenFailure)failure;
        [Export("createTokenWithNameOnCard:cardNumber:expirationMonth:expirationYear:CVC:success:failure:")]
        void CreateTokenWithNameOnCard(string holderName, string cardNumber, string expirationMonth, string expirationYear, string CVC, requestUpdateTokenSuccess success, requestTokenFailure failure);

        // -(void)createAPMTokenWithAPMName:(NSString *)apmName countryCode:(NSString *)countryCode apmFields:(NSDictionary *)apmFields shopperLanguageCode:(NSString *)shopperLanguageCode success:(requestUpdateTokenSuccess)success failure:(requestTokenFailure)failure;
        [Export("createAPMTokenWithAPMName:countryCode:apmFields:shopperLanguageCode:success:failure:")]
        void CreateAPMTokenWithAPMName(string apmName, string countryCode, NSDictionary apmFields, string shopperLanguageCode, requestUpdateTokenSuccess success, requestTokenFailure failure);

        // -(void)reuseToken:(NSString *)token withCVC:(NSString *)CVC success:(requestUpdateTokenSuccess)success failure:(updateTokenFailure)failure;
        [Export("reuseToken:withCVC:success:failure:")]
        void ReuseToken(string token, string CVC, requestUpdateTokenSuccess success, updateTokenFailure failure);

        // -(void)showCVCModalWithParentView:(UIView *)parentView token:(NSString *)token success:(requestUpdateTokenSuccess)success error:(updateTokenFailure)failure __attribute__((deprecated("")));
        [Export("showCVCModalWithParentView:token:success:error:")]
        void ShowCVCModalWithParentView(UIView parentView, string token, requestUpdateTokenSuccess success, updateTokenFailure failure);

        // -(void)showCVCModalWithParentView:(UIView *)parentView token:(NSString *)token success:(requestUpdateTokenSuccess)success beforeRequest:(void (^)(void))beforeRequest error:(updateTokenFailure)failure;
        [Export("showCVCModalWithParentView:token:success:beforeRequest:error:")]
        void ShowCVCModalWithParentView(UIView parentView, string token, requestUpdateTokenSuccess success, Action beforeRequest, updateTokenFailure failure);

        // -(NSString *)stripCardNumberWithCardNumber:(NSString *)cardNumber;
        [Export("stripCardNumberWithCardNumber:")]
        string StripCardNumberWithCardNumber(string cardNumber);

        // -(BOOL)validateCardNumberBasicWithCardNumber:(NSString *)cardNumber;
        [Export("validateCardNumberBasicWithCardNumber:")]
        bool ValidateCardNumberBasicWithCardNumber(string cardNumber);

        // -(BOOL)validateCardNumberAdvancedWithCardNumber:(NSString *)cardNumber;
        [Export("validateCardNumberAdvancedWithCardNumber:")]
        bool ValidateCardNumberAdvancedWithCardNumber(string cardNumber);

        // -(BOOL)validateCardExpiryWithMonth:(int)month year:(int)year;
        [Export("validateCardExpiryWithMonth:year:")]
        bool ValidateCardExpiryWithMonth(int month, int year);

        // -(BOOL)validateCardCVCWithNumber:(NSString *)cvc;
        [Export("validateCardCVCWithNumber:")]
        bool ValidateCardCVCWithNumber(string cvc);

        // -(BOOL)validateCardHolderNameWithName:(NSString *)holderName;
        [Export("validateCardHolderNameWithName:")]
        bool ValidateCardHolderNameWithName(string holderName);

        // -(NSArray *)validateCardDetailsWithCVC:(NSString *)CVC token:(NSString *)token;
        [Export("validateCardDetailsWithCVC:token:")]
        //[Verify(StronglyTypedNSArray)]
        NSArray ValidateCardDetailsWithCVC(string CVC, string token);

        // -(NSArray *)validateCardDetailsWithHolderName:(NSString *)holderName cardNumber:(NSString *)cardNumber expirationMonth:(NSString *)expirationMonth expirationYear:(NSString *)expirationYear CVC:(NSString *)CVC;
        [Export("validateCardDetailsWithHolderName:cardNumber:expirationMonth:expirationYear:CVC:")]
        //[Verify(StronglyTypedNSArray)]
        NSArray ValidateCardDetailsWithHolderName(string holderName, string cardNumber, string expirationMonth, string expirationYear, string CVC);

        // -(NSArray *)validateAPMDetailsWithAPMName:(NSString *)apmName countryCode:(NSString *)countryCode;
        [Export("validateAPMDetailsWithAPMName:countryCode:")]
        //[Verify(StronglyTypedNSArray)]
        NSArray ValidateAPMDetailsWithAPMName(string apmName, string countryCode);

        // -(BOOL)validateAPMNameWithName:(NSString *)apmName;
        [Export("validateAPMNameWithName:")]
        bool ValidateAPMNameWithName(string apmName);

        // -(BOOL)validateCountryCodeWithCode:(NSString *)countryCode;
        [Export("validateCountryCodeWithCode:")]
        bool ValidateCountryCodeWithCode(string countryCode);

        // -(NSString *)cardType:(NSString *)cardNumber;
        [Export("cardType:")]
        string CardType(string cardNumber);

        // -(NSError *)errorWithTitle:(NSString *)title code:(NSInteger)code;
        [Export("errorWithTitle:code:")]
        NSError ErrorWithTitle(string title, nint code);

        // -(void)makeRequestWithURL:(NSString *)url requestDictionary:(NSDictionary *)requestDictionary method:(NSString *)method success:(requestUpdateTokenSuccess)success failure:(requestTokenFailure)failure additionalHeaders:(NSDictionary *)additionalHeaders;
        [Export("makeRequestWithURL:requestDictionary:method:success:failure:additionalHeaders:")]
        void MakeRequestWithURL(string url, NSDictionary requestDictionary, string method, requestUpdateTokenSuccess success, requestTokenFailure failure, NSDictionary additionalHeaders);
    }

    // typedef void (^requestUpdateTokenSuccess)(int, NSDictionary *);
    delegate void requestUpdateTokenSuccess(int arg0, NSDictionary arg1);

    // typedef void (^requestTokenFailure)(NSDictionary *, NSArray *);
    delegate void requestTokenFailure(NSDictionary arg0, NSObject[] arg1);

    // typedef void (^updateTokenFailure)(NSDictionary *, NSArray *);
    delegate void updateTokenFailure(NSDictionary arg0, NSObject[] arg1);

    // @interface ApplePay (Worldpay)
    [Category]
    [BaseType(typeof(Worldpay))]
    interface Worldpay_ApplePay
    {
        // -(BOOL)canMakePayments;
        [Export("canMakePayments")]
        // [Verify(MethodToProperty)]
        bool CanMakePayments();

        // -(PKPaymentRequest *)createPaymentRequestWithMerchantIdentifier:(NSString *)marchantIdentifier;
        [Export("createPaymentRequestWithMerchantIdentifier:")]
        PKPaymentRequest CreatePaymentRequestWithMerchantIdentifier(string marchantIdentifier);

        // -(void)createTokenWithPayment:(PKPayment *)payment success:(requestUpdateTokenSuccess)success failure:(requestTokenFailure)failure;
        [Export("createTokenWithPayment:success:failure:")]
        void CreateTokenWithPayment(PKPayment payment, requestUpdateTokenSuccess success, requestTokenFailure failure);

        // -(void)createTokenWithPaymentData:(NSData *)paymentData success:(requestUpdateTokenSuccess)success failure:(requestTokenFailure)failure;
        [Export("createTokenWithPaymentData:success:failure:")]
        void CreateTokenWithPaymentData(NSData paymentData, requestUpdateTokenSuccess success, requestTokenFailure failure);
    }

    // @interface WorldpayAPMViewController : UIViewController <UITextFieldDelegate>
    [BaseType(typeof(UIViewController))]
    [Protocol]
    interface WorldpayAPMViewController : IUITextFieldDelegate
    {
        // @property (nonatomic) UIToolbar * customToolbar;
        [Export("customToolbar", ArgumentSemantic.Assign)]
        UIToolbar CustomToolbar { get; set; }

        // @property (nonatomic) UIButton * confirmPurchaseButton;
        [Export("confirmPurchaseButton", ArgumentSemantic.Assign)]
        UIButton ConfirmPurchaseButton { get; set; }

        // @property (nonatomic) NSString * apmName;
        [Export("apmName")]
        string ApmName { get; set; }

        // @property (nonatomic) NSString * address;
        [Export("address")]
        string Address { get; set; }

        // @property (nonatomic) NSString * city;
        [Export("city")]
        string City { get; set; }

        // @property (nonatomic) NSString * postcode;
        [Export("postcode")]
        string Postcode { get; set; }

        // @property (nonatomic) NSString * name;
        [Export("name")]
        string Name { get; set; }

        // @property (nonatomic) NSString * countryCode;
        [Export("countryCode")]
        string CountryCode { get; set; }

        // @property (nonatomic) NSString * currency;
        [Export("currency")]
        string Currency { get; set; }

        // @property (nonatomic) NSString * settlementCurrency;
        [Export("settlementCurrency")]
        string SettlementCurrency { get; set; }

        // @property (nonatomic) NSString * successUrl;
        [Export("successUrl")]
        string SuccessUrl { get; set; }

        // @property (nonatomic) NSString * cancelUrl;
        [Export("cancelUrl")]
        string CancelUrl { get; set; }

        // @property (nonatomic) NSString * failureUrl;
        [Export("failureUrl")]
        string FailureUrl { get; set; }

        // @property (nonatomic) NSString * pendingUrl;
        [Export("pendingUrl")]
        string PendingUrl { get; set; }

        // @property (nonatomic) NSString * shopperLanguageCode;
        [Export("shopperLanguageCode")]
        string ShopperLanguageCode { get; set; }

        // @property (nonatomic) NSString * swiftCode;
        [Export("swiftCode")]
        string SwiftCode { get; set; }

        // @property (nonatomic) NSString * customerOrderCode;
        [Export("customerOrderCode")]
        string CustomerOrderCode { get; set; }

        // @property (nonatomic) NSString * orderDescription;
        [Export("orderDescription")]
        string OrderDescription { get; set; }

        // @property (nonatomic) NSDictionary * customerIdentifiers;
        [Export("customerIdentifiers", ArgumentSemantic.Assign)]
        NSDictionary CustomerIdentifiers { get; set; }

        // @property (nonatomic) float price;
        [Export("price")]
        float Price { get; set; }

        // @property (nonatomic) APMDetailsTheme theme;
        [Export("theme", ArgumentSemantic.Assign)]
        APMDetailsTheme Theme { get; set; }

        // @property (nonatomic) APMDetailsLoadingTheme loadingTheme;
        [Export("loadingTheme", ArgumentSemantic.Assign)]
        APMDetailsLoadingTheme LoadingTheme { get; set; }

        // -(id)initWithAPMName:(NSString *)apmName;
        [Export("initWithAPMName:")]
        IntPtr Constructor(string apmName);

        // -(id)initWithColor:(UIColor *)color loadingTheme:(APMDetailsLoadingTheme)loadingTheme apmName:(NSString *)apmName;
        [Export("initWithColor:loadingTheme:apmName:")]
        IntPtr Constructor(UIColor color, APMDetailsLoadingTheme loadingTheme, string apmName);

        // -(void)addLoadingBackground;
        [Export("addLoadingBackground")]
        void AddLoadingBackground();

        // -(void)removeLoadingBackground;
        [Export("removeLoadingBackground")]
        void RemoveLoadingBackground();

        // -(void)setCreateAPMOrderBlockWithSuccess:(createAPMOrderSuccess)success failure:(createAPMOrderFailure)failure;
        [Export("setCreateAPMOrderBlockWithSuccess:failure:")]
        void SetCreateAPMOrderBlockWithSuccess(createAPMOrderSuccess success, createAPMOrderFailure failure);
    }

    // typedef void (^createAPMOrderSuccess)(NSDictionary *);
    delegate void createAPMOrderSuccess(NSDictionary arg0);

    // typedef void (^createAPMOrderFailure)(NSDictionary *, NSArray *);
    delegate void createAPMOrderFailure(NSDictionary arg0, NSObject[] arg1);

    // @interface WorldpayCardViewController : UIViewController <UITextFieldDelegate>
    [BaseType(typeof(UIViewController))]
    [Protocol]
    interface WorldpayCardViewController : IUITextFieldDelegate
    {
        // @property (nonatomic) CardDetailsTheme theme;
        [Export("theme", ArgumentSemantic.Assign)]
        CardDetailsTheme Theme { get; set; }

        // @property (nonatomic) CardDetailsLoadingTheme loadingTheme;
        [Export("loadingTheme", ArgumentSemantic.Assign)]
        CardDetailsLoadingTheme LoadingTheme { get; set; }

        // @property (nonatomic) CardDetailsTextField textField;
        [Export("textField", ArgumentSemantic.Assign)]
        CardDetailsTextField TextField { get; set; }

        // -(id)initWithColor:(UIColor *)color loadingTheme:(CardDetailsLoadingTheme)loadingTheme;
        [Export("initWithColor:loadingTheme:")]
        IntPtr Constructor(UIColor color, CardDetailsLoadingTheme loadingTheme);

        // -(void)shakeTextField:(CardDetailsTextField)textField;
        [Export("shakeTextField:")]
        void ShakeTextField(CardDetailsTextField textField);

        // -(void)showWarningView;
        [Export("showWarningView")]
        void ShowWarningView();

        // -(void)addLoadingBackground;
        [Export("addLoadingBackground")]
        void AddLoadingBackground();

        // -(void)removeLoadingBackground;
        [Export("removeLoadingBackground")]
        void RemoveLoadingBackground();

        // -(void)setSaveButtonTapBlockWithSuccess:(requestTokenSuccess)success failure:(requestTokenFailure)failure;
        [Export("setSaveButtonTapBlockWithSuccess:failure:")]
        void SetSaveButtonTapBlockWithSuccess(requestTokenSuccess success, requestTokenFailure failure);
    }

    // typedef void (^requestTokenSuccess)(NSDictionary *);
    delegate void requestTokenSuccess(NSDictionary arg0);

    // typedef void (^requestTokenFailure)(NSDictionary *, NSArray *);
    //delegate void requestTokenFailure(NSDictionary arg0, NSObject[] arg1);

    // @interface WorldpayUtils : NSObject
    [BaseType(typeof(NSObject))]
    [Protocol]
    interface WorldpayUtils
    {
        // +(void)loadFont:(NSString *)fontName;
        [Static]
        [Export("loadFont:")]
        void LoadFont(string fontName);

        // +(void)sendDebug:(NSString *)string;
        [Static]
        [Export("sendDebug:")]
        void SendDebug(string @string);
    }
}

Simply trying to instantiate a Worldpay instance results in the following exceptions (different on Simulator & Device)

Simulator:-

System.Exception: Could not create an native instance of the type 'TPBinding.Worldpay': the native class hasn't been loaded.
It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
  at Foundation.NSObject.InitializeObject (System.Boolean alloced) [0x0002e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/Foundation/NSObject2.cs:196
  at Foundation.NSObject..ctor (Foundation.NSObjectFlag x) [0x0000d] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/Foundation/NSObject2.cs:131
  at TPBinding.Worldpay..ctor () [0x00000] in /Users/davidp/Documents/TPWorldpay/WorldpayTest/TPBindings/obj/Debug/ios/TPBinding/Worldpay.g.cs:615
  at WorldpayTest.iOS.Services.NativePaymentService.Init () [0x00001] in /Users/davidp/Documents/TPWorldpay/WorldpayTest/WorldpayTest.iOS/Services/NativePaymentService.cs:13
  at WorldpayTest.Views.ItemsPage.OnAppearing () [0x00008] in /Users/davidp/Documents/TPWorldpay/WorldpayTest/WorldpayTest/Views/ItemsPage.xaml.cs:51
  at Xamarin.Forms.Page.SendAppearing () [0x00024] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:359
  at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidAppear (System.Boolean animated) [0x0004b] in <6d6f830f76b442a8953f9ae13539c687>:0
  at at (wrapper managed-to-native) 

Physical Device:-

ObjCRuntime.RuntimeException: Wrapper type 'TPBinding.Worldpay' is missing its native ObjectiveC class 'Worldpay'.
  at Registrar.DynamicRegistrar.OnRegisterType (Registrar.Registrar+ObjCType type) [0x000e1] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/ObjCRuntime/DynamicRegistrar.cs:847
  at Registrar.Registrar.RegisterTypeUnsafe (System.Type type, System.Collections.Generic.List`1[System.Exception]& exceptions) [0x00f05] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:2369
  at Registrar.Registrar.RegisterType (System.Type type, System.Collections.Generic.List`1[System.Exception]& exceptions) [0x00011] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/ObjCRuntime/Registrar.cs:1441
  at Registrar.DynamicRegistrar.Register (System.Type type) [0x00002] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/ObjCRuntime/DynamicRegistrar.cs:1163
  at ObjCRuntime.Class.Register (System.Type type) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/ObjCRuntime/Class.cs:237
  at ObjCRuntime.Class.GetClassHandle (System.Type type, System.Boolean throw_if_failure, System.Boolean& is_custom_type) [0x000ea] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/ObjCRuntime/Class.cs:170
  at ObjCRuntime.Class.GetClassHandle (System.Type type) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/ObjCRuntime/Class.cs:181
  at ObjCRuntime.Class.GetHandle (System.Type type) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/ObjCRuntime/Class.cs:134
  at Foundation.NSObject.AllocIfNeeded () [0x00012] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/Foundation/NSObject2.cs:511
  at Foundation.NSObject..ctor (Foundation.NSObjectFlag x) [0x00006] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/Foundation/NSObject2.cs:130
  at TPBinding.Worldpay..ctor () [0x00000] in /Users/davidp/Documents/TPWorldpay/WorldpayTest/TPBindings/obj/Debug/ios/TPBinding/Worldpay.g.cs:615
  at WorldpayTest.iOS.Services.NativePaymentService.Init () [0x00001] in /Users/davidp/Documents/TPWorldpay/WorldpayTest/WorldpayTest.iOS/Services/NativePaymentService.cs:13
  at WorldpayTest.Views.ItemsPage.OnAppearing () [0x00008] in /Users/davidp/Documents/TPWorldpay/WorldpayTest/WorldpayTest/Views/ItemsPage.xaml.cs:51
  at Xamarin.Forms.Page.SendAppearing () [0x00024] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:359
  at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidAppear (System.Boolean animated) [0x0004b] in <6d6f830f76b442a8953f9ae13539c687>:0
  at at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.14.0.114/src/Xamarin.iOS/UIKit/UIApplication.cs:86

I have been looking at the linking side of things but I am usure as to where I go now?

Dooie
  • 1,649
  • 7
  • 30
  • 47
  • 1
    Can you please check the points in the answer of [this thread](https://stackoverflow.com/questions/24316352/xamarin-binding-wrapper-type-is-missing-its-native-objectivec-class) to see if it helps. – nevermore Sep 04 '19 at 07:01
  • Make sure that the Native library is part of the Xamarin source code and also make sure that this is marked as a **Framework** – pinedax Sep 04 '19 at 18:18
  • @pinedax when you say 'Make sure that the Native library is part of the Xamarin source' do you mean the xamarin.ios project or the binding project? – Dooie Sep 05 '19 at 13:25
  • @Dooie I actually meant the binding project. – pinedax Sep 05 '19 at 14:26
  • My .FAT lib is being generated incorrectly. Running the nm command to check if the Worldpay object exists against the individual architectures within all but the i386 have it. Jack, the 4th point made by @Rolf Bjarne Kvinge led me to this. I now need to identify why these libs are not being generated as expected? Build settings? – Dooie Sep 05 '19 at 19:50
  • @pinedax so the .FAT must physically be in the project, not just a Native reference. This isn't clear in a lot of the docs/posts as most refer to the .linkwith.cs file now being Deprecated but this now makes sense also. – Dooie Sep 05 '19 at 20:03

0 Answers0