Skip to content

Bindingsgenerator stops recognizing C# types #543

Closed
@MFinkBK

Description

@MFinkBK

I have a bindings project where we bind a Brother Printer SDK library. Starting with VS 2019 16.4.0 we get warnings about missing managed types. This is the first line of about 30:

warning BG8800: Unknown parameter type System.Collections.Generic.IList<Java.Util.Locale.LanguageRange> in method Filter in managed type Java.Util.Locale.

Compiling and linking with the app project works fine, no further warnings. I can attach the whole log if needed.

I checked the msbuild output and saw the call to the generator.exe in the Xamarin Android folder (formatted for readability):

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\Android\generator.exe" ^
 obj\Debug\api.xml ^
 --codegen-target=XAJavaInterop1 ^
 --csdir=obj\Debug\generated\src ^
 --enumdir=obj\Debug\generated\enums ^
 --enummetadata=obj\Debug\generated\metadata ^
 --assembly=BrotherSDK.Android ^
 --ref="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" ^
 --ref="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Java.Interop.dll" ^
 --ref="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0\Mono.Android.dll" ^
 --ref="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll" ^
 --ref="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll" ^
 --ref="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.Runtime.dll" ^
 --ref="C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll" ^
 --fixup=Transforms\Metadata.xml ^
 --enumfields=Transforms\EnumFields.xml ^
 --enummethods=Transforms\EnumMethods.xml ^
 --api-level=28 ^
 --type-map-report=obj\Debug\generated\type-mapping.txt ^
 --global ^
 --public

When I run this command line in the project folder, I get (as expected) the same errors as in Visual Studio 2019. Now when I'm changing the path to generator.exe to use the VS 2017 generator.exe (but not changing the references to MonoAndroid assemblies), I get no warnings.

How can I fix these warnings? Or is this a regression in the generator.exe tool? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions