I created a binding project for Xamarin iOS. I succeeded in adding the native library, creating the C# Bindings and resolved all the hundreds of errors I found just to get this error once I try to run the library (in an app on the iPhone simulator):
Could not create a native instance of the type 'MyNamespace.STPPaymentCardTextField': the native class hasn't been loaded.
Here is the signature of the interface in objective-c:
@interface STPPaymentCardTextField : UIControl <UIKeyInput>
Here is what I get in my C# iOS binding:
[BaseType(typeof(UIControl))]
[Protocol]
interface STPPaymentCardTextField : IUIKeyInput
I read this stackoverflow answer and checked the architecture for which my library was built and here is the architecture, taking into consideration that I run it on the iOS simulator:
are: i386 x86_64
here is the script I use to build the library:
all: lib$(TARGET).a
lib$(TARGET)-i386.a:
$(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphonesimulator -configuration Release
clean build
-mv $(PROJECT_ROOT)/build/Release-iphonesimulator/lib$(TARGET).a $@
lib$(TARGET).a: lib$(TARGET)-i386.a
xcrun -sdk iphoneos lipo -create -output $@ $^
clean:
-rm -f *.a *.dll
How can I resolve this error please ?