0
votes

I have created ios binding in xamarin for the latest firebase sdk. I added following

[assembly: LinkWith("Firebase.a", LinkTarget.Simulator | LinkTarget.ArmV7, ForceLoad = true, Frameworks = "CFNetwork Security SystemConfiguration", LinkerFlags = "-ObjC -fobjc-arc -licucore -lc++")]

When i compile, during the 'Compiling to native code' stage, the compiler errors out with following message:

error MT5211: Native linking failed, undefined Objective-C class: _OBJC_CLASS_$_FirebaseHandle. If '_OBJC_CLASS_$_FirebaseHandle' is a protocol from a third-party binding, please check that it has the [Protocol] attribute in its api definition file, otherwise verify that all the necessary frameworks have been referenced and native libraries are properly linked in.

Any idea why this could be happening?

[Update]

On further analysis, i found one of the header file of firebase sdk has following entry

typedef NSUInteger FirebaseHandle;

I have added corresponding binding information in ApiDefinition.cs file as well

[BaseType(typeof(NSObject))]
interface FirebaseHandle
{
}

But i still get the error

1
Yes, but thats a very old post. I am using the latest version of the sdk as it isKartik
But did you add that library "libc++.dylib"?Frank van Puffelen
I did - LinkerFlags = "-ObjC -fobjc-arc -licucore -lc++"Kartik
One more update, this works in simulator but fails to deploy on a device - iphone 5sKartik

1 Answers

2
votes

Try adding

SmartLink = true

To the x.linkwith.cs file

and remove from your ApiDefinition.cs

[BaseType(typeof(NSObject))]
interface FirebaseHandle
{
}