Binding library for google.MLKit.BarcodeScanning from cocoapod creates 13 pods but only 4 of them have .framework files

246 Views Asked by At

I'm creating a binding library for MLKitBarcodeScanning from it's cocoapod, to be used in Xamarin.ios project. After executing the sharpie bind command it creates the pod folder with 13 pods. But only the MLKitBarcodeScanning, MLKitVision, MLKitCommon, MLImage folders has a framework that I can add as a native reference in my binding library. GoogleDataTransport and other folders does not have any .framework file. So I'm getting errors like: Native linking failed, undefined Objective-C class: GDTCORTransport. The symbol '_OBJC_CLASS_$_GDTCORTransport' could not be found in any of the libraries or frameworks linked with your application. when building the project.

I have tried re initialising the podfile and also I have already created the ApiDefinitions and Structs from the header files. Also I have added LinkerFlags -libc++ -undefined -ObjC -lc++ And has set IsCxx true

Edit: From those folders which are not frameworks or libraries (Including GoogleDataTransport), I created a static library following this Create Static Library And linked it as a Native reference in my binding project. Still the errors are the same

2

There are 2 best solutions below

1
Paul Beusterien On

CocoaPods packages can distribute as source distributions or binary distributions. The MLKitBarcodeScanning dependencies without .frameworks are source distributions and get built directly with the app.

2
Zack On

So I'm getting errors like: Native linking failed, undefined Objective-C class: GDTCORTransport. The symbol 'OBJC_CLASS$_GDTCORTransport' could not be found in any of the libraries or frameworks linked with your application.

A third-party binding bound an Objective-C protocol, but did not annotate it with the [Protocol] attribute in its api definition. You need to add the missing [Protocol] attribute.