Reputation: 4329
I've bound an iOS library, SVGKit, to C# using Xamarin/Monotouch. After some issues I've managed to get the library to build ok.
My code can be found here: https://github.com/jamesmundy/SVGKit.Xamarin
Unfortunately, when I try to initialise a type from the class I receive the following error:
Could not initialize an instance of the type 'SVGKitBindings.SVGKFastImageView': the native 'init' method returned nil. It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false.
The full stack trace is can be seen here.
Any idea as to what is causing this problem and what I can do to rectify it?
Update: Here is the full Build Output of my project. http://pastebin.com/f60wFm52
Update 2: Tried setting SmartLink to false and rebuilding, same error though a slightly different build output. http://pastebin.com/ApCAz2BP
Upvotes: 4
Views: 1718
Reputation: 19335
Look at the source code for SVGKFastImageView init [1]:
- (id)init
{
NSAssert(false, @"init not supported, use initWithSVGKImage:");
return nil;
}
The managed exception is correct: you can't call this constructor.
Upvotes: 2