There is an known issue: Add support for MLKit Document scanner. Maui will support it when it release.
And you can try to bind it by your self now. I download the aar and bind it.
- Create a new Android Java Library Binding project (I named it DocumentScan) and copy the aar into it.
- Set its build action as
AndroidLibrary
and add following package reference:
<ItemGroup><PackageReference Include="Xamarin.Firebase.Datatransport" Version="119.0.0.2" /><PackageReference Include="Xamarin.GooglePlayServices.Base" Version="118.5.0.2" /><PackageReference Include="Xamarin.GooglePlayServices.Basement" Version="118.4.0.2" /></ItemGroup>
- Add the project reference to your Main Maui project:
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'"><ProjectReference Include="..\DocumentScan\DocumentScan.csproj" /></ItemGroup>
Finally, you can use the api in your project. such as: