--- id: 5B26339F-A202-4E41-9229-D0BC9E77868E title: Xamarin.Mac errors dateupdated: 2017-06-26 --- [//]: # (The original file resides under https://github.com/xamarin/xamarin-macios/tree/master/docs/website/) [//]: # (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/master will be lost on future updates) # MM0xxx: mmp error messages E.g. parameters, environment, missing tools. ### MM0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com An unexpected error condition occurred. Please [file a bug report](https://bugzilla.xamarin.com/enter_bug.cgi?product=Xamarin.Mac) 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://bugzilla.xamarin.com with a test case. This usually indicates a bug in Xamarin.Mac; please file a bug report at [https://bugzilla.xamarin.com](https://bugzilla.xamarin.com/enter_bug.cgi?product=Xamarin.Mac) 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. ### MM0091: This version of Xamarin.Mac requires the * SDK (shipped with Xcode *). Either upgrade Xcode to get the required header files or use the dynamic registrar or set the managed linker behaviour to Link Platform or Link Framework SDKs Only (to try to avoid the new APIs). 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. 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 (http://bugzilla.xamarin.com). ### 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. ### 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. ### MM0135: Did not link system framework '{0}' (referenced by assembly '{1}') because it was introduced in {2} {3}, and we're using the {2} {4} SDK. 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](https://docs.microsoft.com/xamarin/mac/deploy-test/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. # MM1xxx: file copy / symlinks (project related) ### MM1034: Could not create symlink '{file}' -> '{target}': error {number} ## 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} ## 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 ### MM2001: Could not link assemblies ### 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. ### MM2007: Xamarin.Mac Unified API against a full .NET profile does not support linking. Pass the -nolink flag. ### MM2009: Referenced by {0}.{1} ** This message is related to MM2006 ** ### MM2010: Unknown HttpMessageHandler `{0}`. Valid values are HttpClientHandler (default), CFNetworkHandler or NSUrlSessionHandler ### MM2011: Unknown TLSProvider `{0}. Valid values are default or appletls ### MM2012: Only first {0} of {1} "Referenced by" warnings shown. ** This message related to 2009 ** ### 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 `...`. ### 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](https://bugzilla.xamarin.com) along with a complete build log with verbosity enabled (i.e. `-v -v -v -v` in the **Additional mtouch arguments**). ### MM2104: Unable to link assembly '{0}' as it is mixed-mode. 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](https://github.com/xamarin/xamarin-macios/issues/new) 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 exisiting 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. # 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. ### 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](https://github.com/xamarin/xamarin-macios/issues/new) 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 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 at [https://bugzilla.xamarin.com](https://bugzilla.xamarin.com/enter_bug.cgi?product=Xamarin.Mac) 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: ```csharp 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: ```csharp 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 # 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 http://bugzilla.xamarin.com ## 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](mtouch-errors.md#MT5218). ## MM53xx: other tools ### MM5301: pkg-config could not be found. Please install the Mono.framework from http://mono-project.com/Downloads ### 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. # 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 at [https://bugzilla.xamarin.com](https://bugzilla.xamarin.com/enter_bug.cgi?product=Xamarin.Mac). 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 at [https://bugzilla.xamarin.com](https://bugzilla.xamarin.com/enter_bug.cgi?product=Xamarin.Mac). 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. ### MT8027: 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: * If it occurs when deserializing a storyboard/nib/xib and mentioning a managed type that's used in that storyboard/nib/xib, then the fix is to add a constructor that takes a single `IntPtr` argument to that managed type. This constructor should not have any logic (because it's invoked before the native and managed instances are fully created). * A managed wrapper existed at some point, but was collected by the GC. If the native object is still alive, and later resurfaces to managed code, the Xamarin.Mac runtime will try to re-create a managed wrapper instance. In most cases the problem here is that the managed wrapper shouldn't have been collected by the GC in the first place. Possible causes include: * Manually calling Dispose too early on the managed wrapper. * Incorrect bindings for third-party libraries. * Reference-counting bugs in third-party libraries. * It could be a bug in Xamarin.Mac. If this is the case, please file a bug at [https://bugzilla.xamarin.com](https://bugzilla.xamarin.com/enter_bug.cgi?product=Xamarin.Mac).