Donald Jansen
Donald Jansen

Reputation: 1985

Android .aar binding library in Xamarin

I have a .aar library that I am trying to use in Xamarin. most of the components work perfectly however one interface is completely missing In the binding library build in debug I found the following

1>BINDINGSGENERATOR : warning BG8604: top ancestor FaceViewFragment not found for nested type Com.Truesen.Face.Entrance.Fragment.FaceViewFragment._1.
1>BINDINGSGENERATOR : warning BG8604: top ancestor FaceViewFragment not found for nested type Com.Truesen.Face.Entrance.Fragment.FaceViewFragment._2.
1>BINDINGSGENERATOR : warning BG8604: top ancestor FaceViewFragment not found for nested type Com.Truesen.Face.Entrance.Fragment.FaceViewFragment._3.
1>BINDINGSGENERATOR : warning BG8604: top ancestor FaceViewFragment not found for nested type Com.Truesen.Face.Entrance.Fragment.FaceViewFragment.ICameraCallback.
1>BINDINGSGENERATOR : warning BG8604: top ancestor FaceViewFragment not found for nested type Com.Truesen.Face.Entrance.Fragment.FaceViewFragment.CameraOrientationDetector.
1>BINDINGSGENERATOR : warning BG8604: top ancestor FaceViewRfFragment not found for nested type Com.Truesen.Face.Entrance.Fragment.FaceViewRfFragment._1.
1>BINDINGSGENERATOR : warning BG8604: top ancestor FaceViewRfFragment not found for nested type Com.Truesen.Face.Entrance.Fragment.FaceViewRfFragment._2.
1>BINDINGSGENERATOR : warning BG8604: top ancestor FaceViewRfFragment not found for nested type Com.Truesen.Face.Entrance.Fragment.FaceViewRfFragment._3.
1>BINDINGSGENERATOR : warning BG8604: top ancestor FaceViewRfFragment not found for nested type Com.Truesen.Face.Entrance.Fragment.FaceViewRfFragment.ICameraCallback.
1>BINDINGSGENERATOR : warning BG8604: top ancestor FaceViewRfFragment not found for nested type Com.Truesen.Face.Entrance.Fragment.FaceViewRfFragment.CameraOrientationDetector.

ICameraCallback is the interface that I need, what can I do to get the interface to generate correctly ? or how can I add it manually

Here is the link to the .aar file I am using https://drive.google.com/file/d/1ibfvjws26PesBxjojB_UNyWYiFf0yKqK/view?usp=sharing

Upvotes: 0

Views: 684

Answers (1)

Philippe Creytens
Philippe Creytens

Reputation: 816

The internal library relies on androidx.fragment and androidx.annotation, make sure you also add this as a reference to your binding project (packages are on nuget). They might be missing and therefore not create a proper binding. It is important with android bindings to ensure that all dependencies from the java project/library are also added to the xamarin binding project and to your final project. That should let the compiler find the all of the correct references and properly make the binding.

A good way to see if the binding is done correctly is by checking your final project, open the reference to the binding (.dll) in Visual Studio and see what classes & methods are available there. This should resemble the classes and methods in your .aar project.

If this is not the case firstly check the binding for missing references, next option is to add the missing classes/methods etc to the binding manually by using the add-node tag.

Upvotes: 1

Related Questions