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

36 KiB

title description ms.topic ms.prod ms.assetid ms.technology author ms.author ms.date
Xamarin.Mac error messages (mmp) An errors reference guide for mmp. troubleshooting xamarin 5B26339F-A202-4E41-9229-D0BC9E77868E xamarin-mac bradumbaugh brumbaug 03/27/2018

Xamarin.Mac error messages (mmp)

MM0xxx: mmp error messages

E.g. parameters, environment, missing tools.

MM0000: Unexpected error - Please file 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 (e.g. -v -v -v -v in the Additional mmp arguments);
  • A minimal test case that reproduce the error; and
  • 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).

MM0001: This version of Xamarin.Mac requires Mono {0} (the current Mono version is {1}). Please update the Mono.framework from http://mono-project.com/Downloads

MM0003: Application name '{0}.exe' conflicts with an SDK or product assembly (.dll) name.

MM0007: The root assembly '{0}' does not exist

MM0008: You should provide one root assembly only, found {0} assemblies: '{1}'

MM0009: Error while loading assemblies: *.

An error occurred while loading the assemblies from the root assembly references. More information may be provided in the build output.

MM0010: Could not parse the command line arguments: {0}

MM0016: The option '{0}' has been deprecated.

MM0017: You should provide a root assembly

MM0018: Unknown command line argument: '{0}'

MM0020: The valid options for '{0}' are '{1}'.

MM0023: Application name '{0}.exe' conflicts with another user assembly.

MM0026: Could not parse the command line argument '{0}': {1}

MM0043: The Boehm garbage collector is not supported. The SGen garbage collector has been selected instead.

MM0050: You cannot provide a root assembly if --no-root-assembly is passed.

MM0051: An output directory (--output) is required if --no-root-assembly is passed.

MM0053: Cannot disable new refcount with the Unified API.

MM0056: Cannot find Xcode in any of our default locations. Please install Xcode, or pass a custom path using --sdkroot=

MM0059: Could not find the currently selected Xcode on the system: {0};

MM0060: Could not find the currently selected Xcode on the system. 'xcode-select --print-path' returned '{0}', but that directory does not exist.

MM0068: Invalid value for target framework: {0}.

MM0071: Unknown platform: *. This usually indicates a bug in Xamarin.Mac; please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new with a test case.

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

MM0073: Xamarin.Mac * does not support a deployment target of * (the minimum is *). Please select a newer deployment target in your project's Info.plist.

The minimum deployment target is the one specified in the error message; please select a newer deployment target in the project's Info.plist.

If updating the deployment target is not possible, then please use an older version of Xamarin.Mac.

MM0074: Xamarin.Mac * does not support a deployment target of * (the maximum is *). Please select an older deployment target in your project's Info.plist or upgrade to a newer version of Xamarin.Mac.

Xamarin.Mac does not support setting the minimum deployment target to a higher version than the version this particular version of Xamarin.Mac was built for.

Please select an older minimum deployment target in the project's Info.plist, or upgrade to a newer version of Xamarin.Mac.

MM0079: Internal Error - No executable was copied into the app bundle. Please contact 'support@xamarin.com'

MM0080: Disabling NewRefCount, --new-refcount:false, is deprecated.

Xamarin.Mac requires the header files, from the SDK version specified in the error message, to build your application with the static registrar. The recommended way to fix this error is to upgrade Xcode to get the required SDK, this will include all the required header files. If you have multiple versions of Xcode installed, or want to use an Xcode in a non-default location, make sure to set the correct Xcode location in your IDE's preferences.

One potential, alternative solution, is to enable the managed linker. This will remove unused API including, in most cases, the new API where the header files are missing (or incomplete). However this will not work if your project uses API that was introduced in a newer SDK than the one your Xcode provides.

To enable the managed linker, go to your project's Mac Build Options, and set Linker Behavior to either Link Framework SDKs only or Link All.

A second potential, alternative solution, is use the dynamic registrar instead. This will impose a startup cost by dynamically registering types but remove the header file requirement.

A last-straw solution would be to use an older version of Xamarin.Mac, one that supports the SDK your project requires.

MM0097: machine.config file '{0}' can not be found.

MM0098: AOT compilation is only available on Unified

MM0099: Internal error {0}. Please file a bug report with a test case (https://github.com/xamarin/xamarin-macios/issues/new).

MM0114: Hybrid AOT compilation requires all assemblies to be AOT compiled.

MM0129: Debugging symbol file for '*' does not match the assembly and is ignored.

The debugging symbols, either a .pdb (portable pdb only) or a .mdb file, for the specified assembly could not be loaded.

This generally means the assembly is newer or older than the symbols. Since they do not match they cannot be used and the symbols are ignored.

This warning won't affect the application being built, however you might not be able to debug it entirely (in particular the code from specified assembly). Also exceptions, stack traces and crash reports might be missing some information.

Please report this issue to the publisher of the assembly package (e.g. nuget author) so this can be fixed in their future releases.

MM0130: No root assemblies found. You should provide at least one root assembly.

When running --runregistrar, at least one root assembly should be provided.

MM0131: Product assembly '{0}' not found in assembly list: '{1}'

When running --runregistrar, the assembly list should include the product assembly, Xamarin.Mac, XamMac.

MM0132: Unknown optimization: *. Valid values are: *

The specified optimization was not recognized.

The accepted format is [+|-]optimization-name, where optimization-name is one of the values listed in the error message.

See Build optimizations for a complete description of each optimization.

MM0133: Found more than 1 assembly matching '{0}' choosing first: '{1}'

MM0134: 32-bit applications should be migrated to 64-bit.

Apple has announced that it will not allow macOS App Store submissions of 32-bit apps (starting January 2018).

In addition 32-bit applications will not run on the version of macOS after High Sierra "without compromises".

For more details: https://developer.apple.com/news/?id=06282017a

Consider updating your application and any dependencies to 64-bit.

To build your application, Xamarin.Mac must link against system libraries, some of which depend upon the SDK version specified in the error message. Since you are using an older version of the SDK, invocations to those APIs may fail at runtime.

The recommended way to fix this error is to upgrade Xcode to get the needed SDK. If you have multiple versions of Xcode installed or want to use an Xcode in a non-default location, make sure to set the correct Xcode location in your IDE's preferences.

Alternatively, enable the managed linker to remove unused APIs, including (in most cases) the new ones which require the specified library. However, this will not work if your project requires APIs introduced in a newer SDK than the one your Xcode provides.

As a last-straw solution, use an older version of Xamarin.Mac that does not require these new SDKs to be present during the build process.

MM0138: Building 32-bit apps is not possible when using Xcode 10. Please migrate project to the Unified API.

Xcode 10 does not support building 32-bit applications.

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

MM0139: Building 32-bit apps is not possible when using Xcode 10. Please change the architecture in the project's Mac Build options to 'x86_64'.

Xcode 10 does not support building 32-bit applications.

Change the architecture in the project's Mac Build options to 'x86_64' in order to build a 64-bit application.

MM0143: Projects using the Classic API are not supported anymore. Please migrate the project to the Unified API.

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.

MM0144: Building 32-bit apps is not supported anymore. Please change the architecture in the project's Mac Build options to 'x86_64'.

This version of Xamarin.Mac does not support building 32-bit applications.

Change the architecture in the project's Mac Build options to 'x86_64' in order to build a 64-bit application.

MM0147: Unable to parse the cflags '{cflags} from pkg-config: {exception}

MM0148: Unable to parse the linker flags '{linker_flags}' from the LinkWith attribute for the library {library} in {assembly} : {exception}

MM14xx: Product assemblies

MM1401: The required '{0}' assembly is missing from the references

MM1402: The assembly '{0}' is not compatible with this tool

MM1403: {0} '{1}' could not be found. Target framework '{0}' is unusable to package the application.

MM1404: Target framework '{0}' is invalid.

MM1405: useFullXamMacFramework must always target framework .NET 4.5, not '{0}' which is invalid

MM1406: Target framework '{0}' is invalid when targetting Xamarin.Mac 4.5 .NET framwork.

MM1407: Mismatch between Xamarin.Mac reference '{0}' and target framework selected '{1}'.

MM15xx: Assembly gathering (not requiring linker) errors

MM1501: Can not resolve reference: {0}

MM1502: One or more reference(s) to type '{0}' already exists inside '{1}' before linking

This warning might be reported when using --warn-on-type-ref=X if any loaded (unmodified) assembly has a type reference to the type X.

This can be used along with --warnaserror:1502 to ensure a reference to a specific type (e.g. UIKit.UIWebView) is not being used by any assembly used the application.

Notes:

  • Custom attributes are encoded differently and not included inside an assembly type references metadata.
  • Assembly that define a type X do not have a reference (but the definition) of the type (and won't be reported).

MM1503: One or more reference(s) to type '{0}' still exists inside '{1}' after linking

This warning might be reported when using --warn-on-type-ref=X if any linked (modified) assembly has a type reference to the type X.

This can be used along with --warnaserror:1503 to ensure a reference to a specific type (e.g. UIKit.UIWebView) will not be part of (the managed side of) the application.

Notes:

  • Custom attributes are encoded differently and not included inside an assembly type references metadata.
  • Assembly that define a type X do not have a reference (but the definition) of the type (and won't be reported).

MachO.cs

MM1600: Not a Mach-O dynamic library (unknown header '0x{0}'): {1}.

MM1601: Not a static library (unknown header '{0}'): {1}.

MM1602: Not a Mach-O dynamic library (unknown header '0x{0}'): {1}.

MM1603: Unknown format for fat entry at position {0} in {1}.

MM1604: File of type {0} is not a MachO file ({1}).

MM2xxx: Linker

MM20xx: Linker (general) errors

MM2002: Can not resolve reference: {0}

MM2003: Option '{0}' will be ignored since linking is disabled

MM2004: Extra linker definitions file '{0}' could not be located.

MM2005: Definitions from '{0}' could not be parsed.

MM2006: Native library '{0}' was referenced but could not be found.

MM2010: Unknown HttpMessageHandler {0}. Valid values are HttpClientHandler (default), CFNetworkHandler or NSUrlSessionHandler

MM2011: Unknown TLSProvider `{0}. Valid values are default or appletls

MM2013: Failed to resolve the reference to "{0}", referenced in "{1}". The app will not include the referenced assembly, and may fail at runtime.

MM2014: Xamarin.Mac Extensions do not support linking. Request for linking will be ignored. ** This message is obsolete in XM 3.6+ **

MM2016: Invalid TlsProvider {0} option. The only valid value {1} will be used.

MM2017: Could not process XML description: {0}

MM202x: Binding Optimizer failed processing ....

MM2100: Xamarin.Mac Classic API does not support Platform Linking.

MM2103: Error processing assembly '*': *

An unexpected error occured when processing an assembly.

The assembly causing the issue is named in the error message. In order to fix this issue the assembly will need to be provided in a bug report along with a complete build log with verbosity enabled (i.e. -v -v -v -v in the Additional mtouch arguments).

Mixed-mode assemblies can not be processed by the linker.

See https://msdn.microsoft.com/en-us/library/x0w2664k.aspx for more information on mixed-mode assemblies.

MM2106: Could not optimize the call to BlockLiteral.SetupBlock[Unsafe] in * at offset * because *.

The linker reports this warning when it can't optimize a call to BlockLiteral.SetupBlock or Block.SetupBlockUnsafe.

The message will point to the method that calls BlockLiteral.SetupBlock[Unsafe], and it may also give clues as to why the call couldn't be optimized.

Please file an issue along with a complete build log so that we can investigate what went wrong and possibly enable more scenarios in the future.

MM2107: It's not safe to remove the dynamic registrar because {reasons}

The linker reports this warning when the developer requests removal of the dynamic registrar (by passing --optimize:remove-dynamic-registrar to mmp), but the linker determines that it's not safe to do so.

To remove the warning either remove the optimization argument to mmp, or pass --nowarn:2107 to ignore it.

By default this option will be automatically enabled whenever it's possible and safe to do so.

MM2108: '{0}' was stripped of architectures except '{1}' to comply with App Store restrictions. This could break existing codesigning signatures. Consider stripping the library with lipo or disabling with --optimize=-trim-architectures");

The App Store now rejects applications which contain libraries and frameworks which contain 32-bit variants. The library was stripped of unused archtectures when copied into the final application bundle.

This is in general safe, and will reduce application bundle size as an added benefit. However, any bundled framework that is code signed will have its signature invalidated (and resigned later if the application is signed).

Consider using lipo to remove the unnecessary archtectures permanently from the source library. If the application is not being published to the App Store, this removal can be disabled by passing --optimize=-trim-architectures as Additional MMP Arguments.

MM2109: Xamarin.Mac Classic API does not support Platform Linking.

MM2109: Xamarin.Mac 'Partial Static' registrar does not support linking. Disable linking or use another registrar mode.

MM3xxx: AOT

MM30xx: AOT (general) errors

MM3001: Could not AOT the assembly '{0}'

MM3009: AOT of '{0}' was requested but was not found

MM3010: Exclusion of AOT of '{0}' was requested but was not found

MM4xxx: code generation

MM40xx: driver.m

MM4001: The main template could not be expanded to {0}.

MM41xx: registrar

MM4134: Your application is using the '{0}' framework, which isn't included in the MacOS SDK you're using to build your app (this framework was introduced in OSX {2}, while you're building with the MacOS {1} SDK.) This configuration is not supported with the static registrar (pass --registrar:dynamic as an additional mmp argument in your project's Mac Build option to select). Alternatively select a newer SDK in your app's Mac Build options.

MM4162: The type '*' (used as * {2}) is not available in * * (it was introduced in * *)* Please build with a newer * SDK (usually done by using the most recent version of Xcode.

To build your application, Xamarin.Mac must compile against Xcode SDK header files, including new types not available in the SDK version specified in the error message. Since you are using an older version of the SDK, builds using those APIs fails at build time.

The recommended way to fix this error is to upgrade Xcode to get the needed SDK. If you have multiple versions of Xcode installed or want to use an Xcode in a non-default location, make sure to set the correct Xcode location in your IDE's preferences.

Alternatively, enable the managed linker to remove unused APIs, including (in most cases) the new ones which require the specified library. However, this will not work if your project requires APIs introduced in a newer SDK than the one your Xcode provides.

As a last-straw solution, use an older version of Xamarin.Mac that does not require these new SDKs to be present during the build process.

MM4173: The registrar can't compute the block signature for the delegate of type {delegate-type} in the method {method} because *.

This is a warning indicating that the registrar couldn't inject the block signature of the specified method into the generated registrar code, because the registrar couldn't compute it.

This means that the block signature has to be computed at runtime, which is somewhat slower.

There are currently two possible reasons for this warning:

  1. The type of the managed delegate is either a System.Delegate or System.MulticastDelegate. These types don't represent a specific signature, which means the registrar can't compute the corresponding native signature either. In this case the fix is to use a specific delegate type for the block (alternatively the warning can be ignored by adding --nowarn:4173 as an additional mmp argument in the project's Mac Build options).
  2. The registrar can't find the Invoke method of the delegate. This shouldn't happen, so please file an issue with a test project so that we can fix it.

MM4174: Unable to locate the block to delegate conversion method for the method {method}'s parameter #{parameter}.

This is a warning indicating that the static registrar couldn't find the method to create a delegate for an Objective-C block. An attempt will be made at runtime to find the method, but it will likely fail as well (with an MT8009 exception).

One possible reason for this warning is when manually writing bindings for API that uses blocks. It's recommended to use a binding project to bind Objective-C code, in particular when it involves blocks, since it's quite complicated to get it right when doing it manually.

If this is not the case, please file an issue with a test case.

MM4175: The parameter '{parameter}' in the method '{method}' has an invalid BlockProxy attribute (the type passed to the attribute does not have a 'Create' method).

This is a warning indicating that the parameter in the error message has an invalid [BlockProxy] attribute, where the type passed to the attribute is unexpected:

public override NSUrlSessionDataTask CreateDataTask (NSUrl url, [BlockProxy (typeof (UnexpectedType))] NSUrlSessionResponse completionHandler)
{
}

Any [BlockProxy] attributes with invalid types will be ignored.

This also means that removing the attribute will fix the warning:

public override NSUrlSessionDataTask CreateDataTask (NSUrl url, NSUrlSessionResponse completionHandler)
{
}

Xamarin.Mac will instead look for the attribute in the following locations:

  • For method overrides (like the example above), on the base method.
  • For methods implementing protocol members, on the method in the corresponding managed interface.

In all cases the attribute is generated by our binding generator, and should be present in those locations.

If no attribute can be found, then an MM4174 warning will be shown.

Reference: https://github.com/xamarin/xamarin-macios/issues/4072

MM4176: Unable to locate the delegate to block conversion type for the return value of the method {method}.

This is a warning indicating that the static registrar couldn't find the type used to convert a delegate to an Objective-C block. An attempt will be made at runtime to find the method, but it will likely fail as well (with an MM8009 exception).

One possible reason for this warning is when manually writing bindings for API that uses blocks. It's recommended to use a binding project to bind Objective-C code, in particular when it involves blocks, since it's quite complicated to get it right when doing it manually.

If this is not the case, please file a bug report with a test case.

MM4179: The registrar found the abstract type '{type}' in the signature for '{member}'. Abstract types should not be used in the signature for a member exported to Objective-C.

This is a warning, indicating a potential problem where a method or property has a parameter or return type which is abstract. The potential problem occurs at runtime, when the Xamarin.Mac runtime may need to create an instance of such a type, which will fail if the type is abstract.

Possible solutions:

  • Modify the signature in question to not use an abstract type.
  • Make the type not abstract.

If this is an API exposed by Xamarin, please file a new issue on github, if it's a third-party binding, please contact the vendor.

MM5xxx: GCC and toolchain

MM51xx: compilation

MM5101: Missing '{0}' compiler. Please install Xcode 'Command-Line Tools' component.

MM5103: Failed to compile. Error code - {0}. Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new

MM52xx: linking

MM5202: Mono.framework MDK is missing. Please install the MDK for your Mono.framework version from http://mono-project.com/Downloads

MM5203: Can't find libxammac.a, likely because of a corrupted Xamarin.Mac installation. Please reinstall Xamarin.Mac.

MM5204: Invalid architecture. x86_64 is only supported on non-Classic profiles.

MM5205: Invalid architecture '{0}'. Valid architectures are i386 and x86_64 (when --profile=mobile).

MM5218: Can't ignore the dynamic symbol {symbol} (--ignore-dynamic-symbol={symbol}) because it was not detected as a dynamic symbol.

See the equivalent mtouch warning.

MM5219: Not linking with {framework} because it has been removed from {platform}.

The framework in question has been removed, and Xamarin.Mac can't link with it.

Any code that uses the framework must be removed/rewritten.

MM5220: Skipping framework '{nspace}'. It is prohibited (rejected) by the Mac App Store

The application has references to the {nspace} namespace of Xamarin.Mac.dll. The associated OS framework is known to be prohibited in Apple's Mac App Store applications. To avoid rejections mmp will not, by default, natively link with the mentioned framework. Any feature that use the mentioned framework will not work and might crash at runtime.

If needed (e.g. not submitting to the App Store) you can ask mmp to link against the framework by adding --link-prohibited-framework to the Additional mmp arguments in your project's options. You can silence this warning by adding --nowarn=5220 to the Additional mmp arguments in your project's options.

MM5221: Linking against framework '{nspace}'. It is prohibited (rejected) by the Mac App Store

The application has references to the {nspace} namespace of Xamarin.Mac.dll. The associated OS framework is known to be prohibited in Apple's Mac App Store applications.

However mmp was instructed, using --link-prohibited-framework, to natively link to the associated framework. You can silence this warning by adding --nowarn=5221 to the Additional mmp arguments in your project's options.

MM53xx: other tools

MM5305: Missing 'otool' tool. Please install Xcode 'Command-Line Tools' component

MM5306: Missing dependencies. Please install Xcode 'Command-Line Tools' component

MM5308: Xcode license agreement may not have been accepted. Please launch Xcode.

MM5309: Native linking failed with error code 1. Check build log for details.

MM5310: install_name_tool failed with an error code '{0}'. Check build log for details.

MM5311: lipo failed with an error code '{0}'. Check build log for details.

MM5312: pkg-config failed with an error code '{code}'. Check build log for details.

MM5313: Could not find pkg-config. Please install the Mono.framework from https://mono-project.com/Downloads

MM5314: Failed to execute pkg-config: '{0}'. Check build log for details.

MM8xxx: runtime

MM800x: misc

MM8017: The Boehm garbage collector is not supported. Please use SGen instead.

MM8025: Failed to compute the token reference for the type '{type.AssemblyQualifiedName}' because {reasons}

This indicates a bug in Xamarin.Mac. Please file a bug report.

A potential workaround would be to disable the register-protocols optimization, by passing --optimize:-register-protocols as an additional mmp argument in the project's Mac Build options.

MM8026: * is not supported when the dynamic registrar has been linked away.

This usually indicates a bug in Xamarin.Mac, because the dynamic registrar should not be linked away if it's needed. Please file a bug report.

It's possible to force the linker to keep the dynamic registrar by adding --optimize=-remove-dynamic-registrar to the additional mmp arguments in the project's Mac Build options.

MM8027: Failed to marshal the Objective-C object {handle} (type: {managed_type}). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance.

This occurs when the Xamarin.Mac runtime finds an Objective-C object without a corresponding managed wrapper object, and when trying to create that managed wrapper, it turns out it's not possible.

There are a few reasons this may happen:

MM8028: The runtime function {function} has been linked away.

This usually indicates a bug in Xamarin.Mac, because runtime functions should not be linked away if they're needed. Please submit an issue.

MM8029: Unable to marshal the {byref?} parameter {index} whose managed type is {type} to managed.

This usually indicates a bug in Objective-C binding code.

If the managed binding is from a third-party vendor, please contact the vendor.

If the managed binding is shipped with Xamarin.Mac, please submit an issue.

MM8030: Unable to marshal the {byref?} parameter {index} whose managed type is {type} to Objective-C.

This usually indicates a bug in Objective-C binding code.

If the managed binding is from a third-party vendor, please contact the vendor.

If the managed binding is shipped with Xamarin.Mac, please submit an issue.

MM8031: Unable to convert from an NSArray to a managed array of {type}.

This usually indicates a bug in Objective-C binding code.

If the managed binding is from a third-party vendor, please contact the vendor.

If the managed binding is shipped with Xamarin.Mac, please submit an issue.

MM8032: Unable to convert from a managed array of {type} to an NSArray.

This usually indicates a bug in Objective-C binding code.

If the managed binding is from a third-party vendor, please contact the vendor.

If the managed binding is shipped with Xamarin.Mac, please submit an issue.

MM8033: Unable to marshal the return value of type {type} to Objective-C.

This usually indicates a bug in Objective-C binding code.

If the managed binding is from a third-party vendor, please contact the vendor.

If the managed binding is shipped with Xamarin.Mac, please submit an issue.

MM8034: Failed to lookup the required marshalling information.

This exception will have an inner exception which gives the reason for the failure.

MM8035: Failed to get the 'this' instance in a method call to {method}.

This exception will have an inner exception which gives the reason for the failure.

MM8036: Failed to marshal the value at index {index}.

This exception will have an inner exception which gives the reason for the failure.