xamarin-macios/docs/website/generator-errors.md

18 KiB

id title dateupdated
505F978C-9553-49A8-9632-0D6D8A0A0287 Xamarin.iOS/Xamarin.Mac binding errors 2017-06-26

//: # (This allows all contributors (including external) to submit, using a PR, updates to the documentation that match the tools changes) //: # (Modifications outside of xamarin-macios/main will be lost on future updates)

BI0xxx: binding error messages

E.g. parameters, environment

BI0000: Unexpected error - Please fill a bug report at https://github.com/xamarin/xamarin-macios/issues/new

An unexpected error condition occurred. Please file a bug report with as much information as possible, including:

  • Full build logs, with maximum verbosity
  • A minimal test case that reproduce the error
  • All version informations

The easiest way to get exact version information is to use the Xamarin Studio menu, About Xamarin Studio item, Show Details button and copy/paste the version informations (you can use the Copy Information button).

BI0001: The .NET runtime could not load the {mi.ReturnType.Name} type. Message: {ex.Message}

BI0002: Could not compile the API bindings.

This error is shown when the generator failed to compile the API bindings.

BI0026: Could not parse the command line argument '{argument}': {message}

BI0068: Invalid value for target framework: *.

An invalid target framework was passed using the --target-framework argument. Please specify a valid target framework.

BI0070: Invalid target framework: *. Valid target frameworks are: *.

An invalid target framework was passed using the --target-framework argument. Please specify a valid target framework.

BI0086: A target framework (--target-framework) must be specified when building for *.

This usually indicates a bug in Xamarin.iOS/Xamarin.Mac; please file a bug report with a test case.

BI0087: Xamarin.Mac Classic binding projects are not supported anymore. Please upgrade the binding project to a Xamarin.Mac Unified binding project.

Xamarin.Mac does not support the Classic API anymore, because the Classic API is 32-bit only, and macOS 10.15+ does not support 32-bit applications.

The project must be migrated to a Unified project in order to support 64-bit.

BI0088: MonoTouch binding projects are not supported anymore. Please upgrade the binding project to a Xamarin.iOS (Unified) binding project.

MonoTouch is not supported anymore, because it only supports 32-bit.

The project must be migrated to a Xamarin.iOS (Unified) project in order to support 64-bit.

BI0099: Internal error *. Please file a bug report with a test case (https://github.com/xamarin/xamarin-macios/issues/new).

This error message is reported when an internal consistency check fails.

This usually indicates a bug in the binding generator; please file a new issue on github with a test case.

BI1xxx: code generation

<a name='BI1000/>'BI1000: Could not compile the generated API bindings.

This indicates a bug in Xamarin.iOS/Xamarin.Mac; please submit an issue.

BI1001: Do not know how to make a trampoline for *

BI1002: Unknown kind * in method '*'

BI1003: The delegate method . needs to take at least one parameter

BI1004: The delegate method . is missing the [EventArgs] attribute (has * parameters)

BI1005: EventArgs in . attribute should not include the text `EventArgs' at the end

BI1006: The delegate method . is missing the [DelegateName] attribute (or EventArgs)

BI1007: Unknown attribute * on *

BI1008: [IsThreadStatic] is only valid on properties that are also [Static]

BI1009: No selector specified for method `.'

BI1010: No Export attribute on . property

BI1011: Do not know how to extract type / from an NSDictionary

BI1012: No Export or Bind attribute defined on .

BI1013: Unsupported type for Fields (string), you probably meant NSString

BI1014: Unsupported type for Fields: * for '*'.

Please go to [FieldAttribute] documentation to see supported types.

BI1015: In class * You specified the Events property, but did not bind those to names with Delegates

BI1016: The delegate method . is missing the [DefaultValue] attribute

BI1017: Do not know how to make a signature for *

BI1018: No [Export] attribute on property .

BI1019: Invalid [NoDefaultValue] attribute on method `.'

BI1020: Unsupported type * used on exported method .

BI1021: Unsupported type for read/write Fields: *

BI1022: Model classes can not be categories

BI1023: The number of Events (Type) and Delegates (string) must match for *

BI1024: No selector specified for property '.'

BI1025: [Static] and [Protocol] are mutually exclusive (*)

BI1026: *: Enums attributed with [*] must have an underlying type of long or ulong

BI1027: Support for ZeroCopy strings is not implemented. Strings will be marshalled as NSStrings.

BI1028: Internal sanity check failed, please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.

BI1029: Internal error: invalid enum mode for type '*'

BI1030: * cannot have [BaseType(typeof(*))] as it creates a circular dependency

BI1031: The [Target] attribute is not supported for the Unified API (found on the member '.'). For Objective-C categories, create an api definition interface with the [Category] attribute instead.

BI1034: The [Protocolize] attribute is set on the property ., but the property's type (*) is not a protocol.

BI1035: The property * on class * is hiding a property from a parent class * but the selectors do not match.

BI1036: The last parameter in the method '.' must be a delegate (it's '*').

BI1037: The selector * on type * is found multiple times with both read only and write only versions, with no read/write version.

BI1038: The selector * on type * is found multiple times with different return types.

BI1039: The selector * on type * is found multiple times with different argument length * : *.

BI1040: The selector * on type * is found multiple times with different argument out states on argument *.

BI1041: The selector * on type * is found multiple times with different argument types on argument * - * : *.

BI1042: Missing '[Field (LibraryName=value)]' for {field_pi.Name} (e.g."__Internal")

BI1043: Repeated overload {mi.Name} and no [DelegateApiNameAttribute] provided to generate property name on host class.

BI1044: Repeated name '{apiName.Name}' provided in [DelegateApiNameAttribute].

BI1045: Only a single [DefaultEnumValue] attribute can be used inside enum {type.Name}.

BI1046: The [Field] constant {fa.SymbolName} cannot only be used once inside enum {type.Name}.

BI1047: Unsupported platform: *. Please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.

BI1048: Unsupported type * decorated with [BindAs].

BI1049: Could not unbox type * from * container used on * member decorated with [BindAs].

BI1050: [BindAs] cannot be used inside Protocol or Model types. Type: *

BI1051: Internal error: Don't know how to get attributes for *. Please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.

BI1052: Internal error: Could not find the type * in the assembly *. Please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.

BI1053: Internal error: unknown target framework '*'.

BI1054: Internal error: can't convert type '*' (unknown assembly). Please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.

This usually indicates a bug in Xamarin.iOS/Xamarin.Mac; please file a bug report with a test case.

BI1055: Internal error: failed to convert type '*'. Please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.

This usually indicates a bug in Xamarin.iOS/Xamarin.Mac; please file a bug report with a test case.

BI1056: Internal error: failed to instantiate mock attribute '' (could not convert type constructor argument #). Please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.

This usually indicates a bug in Xamarin.iOS/Xamarin.Mac; please file a bug report with a test case.

BI1057: Internal error: failed to instantiate mock attribute '' (could not convert constructor type # (*)). Please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.

This usually indicates a bug in Xamarin.iOS/Xamarin.Mac; please file a bug report with a test case.

BI1058: Internal error: could not find a constructor for the mock attribute '*'. Please file a bug report (https://github.com/xamarin/xamarin-macios/issues/new) with a test case.

This usually indicates a bug in Xamarin.iOS/Xamarin.Mac; please file a bug report with a test case.

BI1059: Found * * attributes on the member *. At most one was expected.

BI1060: The * protocol is decorated with [Model], but not [BaseType]. Please verify that [Model] is relevant for this protocol; if so, add [BaseType] as well, otherwise remove [Model].

BI1061: The attribute '{attribute}' found on '{member}' is not a valid binding attribute. Please remove this attribute.

BI1062: The member '*' contains ref/out parameters and must not be decorated with [Async].

BI1063: The 'WrapAttribute' can only be used at the property or at getter/setter level at a given time. Property: '*'.

BI1064: Unsupported ref/out parameter type '{type}' for the parameter '{name}' in {method}.

BI1065: Unsupported parameter type '{type}' for the parameter '{name}' in {method}.

BI1066: Unsupported return type '{type}' in {method}.

BI1067: The type '{type}' is trying to inline the property '{property}' from the protocols '{readonly.DeclaringType.FullName}' and '{writeonly.DeclaringType.FullName}', but the inlined properties don't share the same accessors ('{readonly}' is read-only, while '${writeonly}' is write-only).

BI1068: The type '{type}' is trying to inline the property '{property}' from the protocols '{protocol1}' and '{protocol2}', and the inlined properties use different selectors ({protocol1} uses '{selector1}', and {protocol2} uses '{selector2}.

BI1069: The type '{type}' is trying to inline the methods binding the selector '{selector}' from the protocols '{protocol1}' and '{protocol2}', using methods with different signatures ('{signature}' vs '{signature2}').

BI1070: The type '{type}' is trying to inline the property '{property}' from the protocols '{protocol1}' and '{protocol2}', but the inlined properties are of different types ('{property1}' is int, while '{property2}' is int).

BI1071: The BindAs type for the member "{type}.{member}" must be an array when the member's type is an array. See example binding below.

Correct:

[BindAs (typeof (string []))]
[Export ("stringProp")]
NSString[] StringProp { get; }

Incorrect:

[BindAs (typeof (string))]
[Export ("stringProp")]
NSString[] StringProp { get; }

BI1072: Missing [CoreImageFilterProperty] attribute on {type} property {name}

This error happens when a binding type, decorated with [CoreImageFilter] attribute, has properties that are not decorated with a [CoreImageFilterProperty] attribute. E.g.

[CoreImageFilter]
[BaseType (typeof (CIFilter))]
interface CICustomFilter  {

	CGAffineTransform Transform { get; }
}

To solve this error you need to tell the CIFilter key that you want to map to the property, e.g.

[CoreImageFilter]
[BaseType (typeof (CIFilter))]
interface CICustomFilter  {

	[CoreImageFilterProperty ("inputTransform")]
	CGAffineTransform Transform { get; }
}

If the property is inlined from a protocol then the [Export] value, prefixed with input, will be used by default. You can override this with by adding the [CoreImageFilterProperty] attribute (e.g. for output* keys).

# BI11xx: warnings

BI1101: Trying to use a string as a [Target]

BI1102: Using the deprecated EventArgs for a delegate signature in ., please use DelegateName instead

BI1104: Could not load the referenced library '*': *.

BI1105: Potential selector/argument mismatch [Export ("*")] has * arguments and . has * arguments

BI1106: The parameter * in the method . exposes a model (). Please expose the corresponding protocol type instead (.I*)

BI1107: The return type of the method . exposes a model (). Please expose the corresponding protocol type instead (.I*).

BI1108: The [Protocolize] attribute is applied to the return type of the method ., but the return type (*) isn't a model and can thus not be protocolized. Please remove the [Protocolize] attribute.

BI1109: The return type of the method . exposes a model (). Please expose the corresponding protocol type instead (.I*).

BI1110: The property . exposes a model (). Please expose the corresponding protocol type instead (.I*).

BI1111: Interface '' on '' is being ignored as it is not a protocol. Did you mean '*' instead?

BI1112: Property * should be renamed to 'Delegate' for BaseType.Events and BaseType.Delegates to work.

BI1113: BaseType.Delegates were set but no properties could be found. Do ensure that the WrapAttribute is used on the right properties.

BI1114: Binding error: test unable to find property: * on *.

BI1115: The parameter '' in the delegate '' does not have a [CCallback] or [BlockCallback] attribute. Defaulting to [CCallback].

BI1116: The parameter '' in the delegate '' does not have a [CCallback] or [BlockCallback] attribute. Defaulting to [CCallback]. Declare a custom delegate instead of using System.Action / System.Func and add the attribute on the corresponding parameter.

BI1117: The member '*' is decorated with [Static] and its container class * is decorated with [Category] this leads to hard to use code. Please inline * into * class.

[NullAllowed] should not be used on methods, like '*', but only on properties, parameters and return values.

The [NullAllowed] attribute should not be allowed on methods but it could break existing binding projects.

Historically it was used on property setters. However using the attribute on other methods can be misleading, e.g. should it apply to all parameters, the return value... and its presence/action can be misinterpreted in code reviews leading to binding bugs.

To fix this warning use the [NullAllowed] attribute only on parameters, properties or return values.