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

936 строки
36 KiB
Markdown
Исходник Обычный вид История

---
title: "Xamarin.Mac error messages (mmp)"
description: "An errors reference guide for mmp."
ms.topic: troubleshooting
ms.prod: xamarin
ms.assetid: 5B26339F-A202-4E41-9229-D0BC9E77868E
ms.technology: xamarin-mac
author: bradumbaugh
ms.author: brumbaug
ms.date: 03/27/2018
---
# Xamarin.Mac error messages (mmp)
## MM0xxx: mmp error messages
E.g. parameters, environment, missing tools.
<a name="MM0000" />
#### 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](https://github.com/xamarin/xamarin-macios/issues/new) 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).
<a name="MM0001" />
#### 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
<a name="MM0003" />
#### MM0003: Application name '{0}.exe' conflicts with an SDK or product assembly (.dll) name.
<a name="MM0007" />
#### MM0007: The root assembly '{0}' does not exist
<a name="MM0008" />
#### MM0008: You should provide one root assembly only, found {0} assemblies: '{1}'
<a name="MM0009" />
#### 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.
<a name="MM0010" />
#### MM0010: Could not parse the command line arguments: {0}
<!-- 0013 is unused -->
<a name="MM0016" />
#### MM0016: The option '{0}' has been deprecated.
<a name="MM0017" />
#### MM0017: You should provide a root assembly
<a name="MM0018" />
#### MM0018: Unknown command line argument: '{0}'
<a name="MM0020" />
#### MM0020: The valid options for '{0}' are '{1}'.
<a name="MM0023" />
#### MM0023: Application name '{0}.exe' conflicts with another user assembly.
<a name="MM0026" />
#### MM0026: Could not parse the command line argument '{0}': {1}
<a name="MM0043" />
#### MM0043: The Boehm garbage collector is not supported. The SGen garbage collector has been selected instead.
<a name="MM0050" />
#### MM0050: You cannot provide a root assembly if --no-root-assembly is passed.
<a name="MM0051" />
#### MM0051: An output directory (--output) is required if --no-root-assembly is passed.
<a name="MM0053" />
#### MM0053: Cannot disable new refcount with the Unified API.
<a name="MM0056" />
#### MM0056: Cannot find Xcode in any of our default locations. Please install Xcode, or pass a custom path using --sdkroot=<path>
<a name="MM0059" />
#### MM0059: Could not find the currently selected Xcode on the system: {0};
<a name="MM0060" />
#### MM0060: Could not find the currently selected Xcode on the system. 'xcode-select --print-path' returned '{0}', but that directory does not exist.
<a name="MM0068" />
#### MM0068: Invalid value for target framework: {0}.
<a name="MM0071" />
#### 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](https://github.com/xamarin/xamarin-macios/issues/new) with a test case.
<a name="MM0073" />
#### 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.
<a name="MM0074" />
#### 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.
<a name="MM0079" />
#### MM0079: Internal Error - No executable was copied into the app bundle. Please contact 'support@xamarin.com'
<a name="MM0080" />
#### MM0080: Disabling NewRefCount, --new-refcount:false, is deprecated.
<!-- 0088 used by mtouch -->
<!-- 0089 used by mtouch -->
<a name="MM0091" />
#### 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).
2018-04-20 23:20:04 +03:00
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.
<a name="MM0097" />
#### MM0097: machine.config file '{0}' can not be found.
<a name="MM0098" />
#### MM0098: AOT compilation is only available on Unified
<a name="MM0099" />
#### MM0099: Internal error {0}. Please file a bug report with a test case (https://github.com/xamarin/xamarin-macios/issues/new).
<a name="MM0114" />
#### MM0114: Hybrid AOT compilation requires all assemblies to be AOT compiled.
<a name="MM0129" />
#### 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.
<a name="MM0130" />
#### MM0130: No root assemblies found. You should provide at least one root assembly.
When running --runregistrar, at least one root assembly should be provided.
<a name="MM0131" />
#### MM0131: Product assembly '{0}' not found in assembly list: '{1}'
When running --runregistrar, the assembly list should include the product assembly, Xamarin.Mac, XamMac.
<a name="MM0132" />
#### 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](https://developer.xamarin.com/guides/cross-platform/macios/build-optimizations) for a complete description of each optimization.
<a name="MM0133" />
#### MM0133: Found more than 1 assembly matching '{0}' choosing first: '{1}'
<a name="MM0134" />
#### 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](https://docs.microsoft.com/en-us/xamarin/cross-platform/macios/32-and-64/mac-64-bit) to 64-bit.
<a name="MM0135" />
#### 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.
<!-- 0136 and 0137 used by mtouch -->
#### 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](https://docs.microsoft.com/en-us/xamarin/cross-platform/macios/unified/updating-mac-apps) 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.
[mtouch] Update validations around --interpreter (#5772) This also centralize other interpreter checks and options in the same location (making it easier to read / update). * Warn and switch the REPL if the interpreter is enabled on simulator Why ? It's confusing to build the same code using different options for simulator and devices. This is what happens if you try to use features like `dynamic` or `System.Reflection.Emit`. So instead of an error, we warn that the interpreter is not supported and switch to the existing REPL mode. The JIT remains the only option for the simulator but it allows testing features without a device. * Fail early if the interpreter is used on 32bits [1] The current interpreter only works on 64 bits (so ARM64). However the error won't be reported, back to the developer, until deployment time. This temporary [1] fix spot the condition very early and report an error ``` error MT0099 : Internal error : The interpreter is currently only available for 64 bits. ``` instead of the current one at deploy time ``` IncorrectArchitecture: Failed to find matching arch for 32-bit Mach-O input file /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.tNKDlx/extracted/X.app/X error MT1006: Could not install the application 'X.app' on the device 'Mercure': AMDeviceSecureInstallApplicationBundle returned: 0xe8000087 (kAMDIncorrectArchitectureError). Application could not be uploaded to the device. ``` [1] https://github.com/mono/mono/issues/9871 * [tests] Fix/renumbered MT0138 The test was using simulator + interpreter which is not _really_ possible, we use REPL in that case - so we're now checking if assemblies were specified with `--interpreter` to cover both cases. Also 0138 was already used by `mmp` and the warning was **not** registered or documented in the errors documents. To avoid confusion it has been renumbered to 0142 and documented.
2019-03-19 16:22:39 +03:00
<!-- 0140-0142 taken my mtouch -->
#### 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](https://docs.microsoft.com/en-us/xamarin/cross-platform/macios/unified/updating-mac-apps) 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.
<!-- 0145 and 0146 used by mtouch -->
Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process. (#7177) * Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process. mono changed how quotes should be escaped when passed to System.Diagnostic.Process, so we need to change accordingly. The main difference is that single quotes don't have to be escaped anymore. This solves problems like this: System.ComponentModel.Win32Exception : ApplicationName='nuget', CommandLine='restore '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable/CellCustomTable.sln' -Verbosity detailed -SolutionDir '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable'', CurrentDirectory='/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories', Native error= Cannot find the specified file at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0029f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-08/external/bockbuild/builds/mono-x64/mcs/class/System/System.Diagnostics/Process.cs:778 ref: https://github.com/mono/mono/pull/15047 * Rework process arguments to pass arrays/lists around instead of quoted strings. And then only convert to a string at the very end when we create the Process instance. In the future there will be a ProcessStartInfo.ArgumentList property we can use to give the original array/list of arguments directly to the BCL so that we can avoid quoting at all. These changes gets us almost all the way there already (except that the ArgumentList property isn't available quite yet). We also have to bump to target framework version v4.7.2 from v4.5 in several places because of 'Array.Empty<T> ()' which is now used in more places. * Parse linker flags from LinkWith attributes. * [sampletester] Bump to v4.7.2 for Array.Empty<T> (). * Fix typo. * Rename GetVerbosity -> AddVerbosity. * Remove unnecessary string interpolation. * Remove unused variable. * [mtouch] Simplify code a bit. * Use implicitly typed arrays.
2019-10-14 17:18:46 +03:00
#### 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}
## MM1xxx: file copy / symlinks (project related)
<a name="MM1034" />
#### MM1034: Could not create symlink '{file}' -> '{target}': error {number}
### MM14xx: Product assemblies
<a name="MM1401" />
#### MM1401: The required '{0}' assembly is missing from the references
<a name="MM1402" />
#### MM1402: The assembly '{0}' is not compatible with this tool
<a name="MM1403" />
#### MM1403: {0} '{1}' could not be found. Target framework '{0}' is unusable to package the application.
<a name="MM1404" />
#### MM1404: Target framework '{0}' is invalid.
<a name="MM1405" />
#### MM1405: useFullXamMacFramework must always target framework .NET 4.5, not '{0}' which is invalid
<a name="MM1406" />
#### MM1406: Target framework '{0}' is invalid when targetting Xamarin.Mac 4.5 .NET framwork.
<a name="MM1407" />
#### MM1407: Mismatch between Xamarin.Mac reference '{0}' and target framework selected '{1}'.
### MM15xx: Assembly gathering (not requiring linker) errors
<a name="MM1501" />
#### MM1501: Can not resolve reference: {0}
<a name="MM1502" />
#### 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).
<a name="MM1503" />
#### 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
<a name="MM1600" />
#### MM1600: Not a Mach-O dynamic library (unknown header '0x{0}'): {1}.
<a name="MM1601" />
#### MM1601: Not a static library (unknown header '{0}'): {1}.
<a name="MM1602" />
#### MM1602: Not a Mach-O dynamic library (unknown header '0x{0}'): {1}.
<a name="MM1603" />
#### MM1603: Unknown format for fat entry at position {0} in {1}.
<a name="MM1604" />
#### MM1604: File of type {0} is not a MachO file ({1}).
## MM2xxx: Linker
### MM20xx: Linker (general) errors
<a name="MM2001" />
#### MM2001: Could not link assemblies
<a name="MM2002" />
#### MM2002: Can not resolve reference: {0}
<a name="MM2003" />
#### MM2003: Option '{0}' will be ignored since linking is disabled
<a name="MM2004" />
#### MM2004: Extra linker definitions file '{0}' could not be located.
<a name="MM2005" />
#### MM2005: Definitions from '{0}' could not be parsed.
<a name="MM2006" />
#### MM2006: Native library '{0}' was referenced but could not be found.
<a name="MM2007" />
#### MM2007: Xamarin.Mac Unified API against a full .NET profile does not support linking. Pass the -nolink flag.
<a name="MM2009" />
#### MM2009: Referenced by {0}.{1} ** This message is related to MM2006 **
<a name="MM2010" />
#### MM2010: Unknown HttpMessageHandler `{0}`. Valid values are HttpClientHandler (default), CFNetworkHandler or NSUrlSessionHandler
<a name="MM2011" />
#### MM2011: Unknown TLSProvider `{0}. Valid values are default or appletls
<a name="MM2012" />
#### MM2012: Only first {0} of {1} "Referenced by" warnings shown. ** This message related to 2009 **
<a name="MM2013" />
#### MM2013: Failed to resolve the reference to "{0}", referenced in "{1}". The app will not include the referenced assembly, and may fail at runtime.
<a name="MM2014" />
#### MM2014: Xamarin.Mac Extensions do not support linking. Request for linking will be ignored. ** This message is obsolete in XM 3.6+ **
<!-- 2015 used by mtouch -->
<a name="MM2016" />
#### MM2016: Invalid TlsProvider `{0}` option. The only valid value `{1}` will be used.
<a name="MM2017" />
#### MM2017: Could not process XML description: {0}
<a name="MM202x" />
#### MM202x: Binding Optimizer failed processing `...`.
<a name="MM2100" />
#### MM2100: Xamarin.Mac Classic API does not support Platform Linking.
<a name="MM2103" />
#### 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://github.com/xamarin/xamarin-macios/issues/new) along with a complete build log with verbosity enabled (i.e. `-v -v -v -v` in the **Additional mtouch arguments**).
<a name="MM2104" />
#### 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.
<a name="MM2106" />
#### MM2106: Could not optimize the call to BlockLiteral.SetupBlock[Unsafe] in * at offset * because *.
Optimize calls to BlockLiteral.SetupBlock to inject the block signature. (#3391) * [linker] Optimize calls to BlockLiteral.SetupBlock to inject the block signature. Optimize calls to BlockLiteral.SetupBlock[Unsafe] to calculate the block signature at build time, and inject it into the call site. This makes block invocations 10-15x faster (I've added tests that asserts at least an 8x increase). It's also required in order to be able to remove the dynamic registrar code in the future (since calculating the block signature at runtime requires the dynamic registrar). * [mtouch/mmp] Add support for reporting errors/warnings that point to the code line causing the error/warning. Add support for reporting errors/warnings that point to the code line causing the error/warning by adding ErrorHelper overloads that take the exact instruction to report (previously we defaulted to the first line/instruction in a method). * [tests] Add support for asserting filename/linenumber in warning messages. * Make all methods that manually create BlockLiterals optimizable. * [tests] Create a BaseOptimizeGeneratedCodeTest test that's included in both XI's and XM's link all test. * [tests] Add link all test (for both XI and XM) to test the BlockLiteral.SetupBlock optimization. * [tests] Add mtouch/mmp tests for the BlockLiteral.SetupBlock optimization. * [tests][linker] Make the base test class abstract, so tests in the base class aren't executed twice. * [tests][linker] Don't execute linkall-only tests in linksdk. The optimization tests only apply when the test assembly is linked, and that only happens in linkall, so exclude those tests in linksdk. * [tests][mmptest] Update test according to mmp changes. Fixes these test failures: 1) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("inline-runtime-arch") The warning 'MM0132: Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output: Message #1 did not match: actual: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.' expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' Message #2 did not match: actual: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.' expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' 2) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("foo") The warning 'MM0132: Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output: Message #1 did not match: actual: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.' expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' Message #2 did not match: actual: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.' expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' * [tests][linker] Fix typo. Fixes this test failure: 1) SetupBlock_CustomDelegate (Linker.Shared.BaseOptimizeGeneratedCodeTest.SetupBlock_CustomDelegate) Counter Expected: 1 But was: 2 * [registrar] Minor adjustment to error message to match previous (and better) behavior. Fixes this test failure: 1) Failed : Xamarin.Registrar.GenericType_WithInvalidParameterTypes The error 'MT4136: The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)'' was not found in the output: Message #1 did not match: actual: 'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<Foundation.NSObject>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)'' expected: 'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)'' * [docs] mmp shows MM errors/warnings. * [docs] Improve according to reviews. * [tests] Fix merge failure causing test duplication.
2018-02-06 09:08:15 +03:00
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.
<a name="MM2107" />
#### 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.
<a name="MM2108" />
#### 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.
<a name="MM2109"/>
#### MM2109: Xamarin.Mac Classic API does not support Platform Linking.
<a name="MM2110"/>
#### MM2109: Xamarin.Mac 'Partial Static' registrar does not support linking. Disable linking or use another registrar mode.
## MM3xxx: AOT
### MM30xx: AOT (general) errors
<a name="MM3001" />
#### MM3001: Could not AOT the assembly '{0}'
<!-- 3002 used by mtouch -->
<!-- 3003 used by mtouch -->
<!-- 3004 used by mtouch -->
<!-- 3005 used by mtouch -->
<!-- 3006 used by mtouch -->
<!-- 3007 used by mtouch -->
<!-- 3008 used by mtouch -->
<a name="MM3009" />
#### MM3009: AOT of '{0}' was requested but was not found
<a name="MM3010" />
#### MM3010: Exclusion of AOT of '{0}' was requested but was not found
## MM4xxx: code generation
### MM40xx: driver.m
<a name="MM4001" />
#### MM4001: The main template could not be expanded to `{0}`.
### MM41xx: registrar
<a name="MM4134" />
#### 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.
<a name="MM4162" />
#### 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.
<a name="MM4173" />
#### MM4173: The registrar can't compute the block signature for the delegate of type {delegate-type} in the method {method} because *.
Optimize calls to BlockLiteral.SetupBlock to inject the block signature. (#3391) * [linker] Optimize calls to BlockLiteral.SetupBlock to inject the block signature. Optimize calls to BlockLiteral.SetupBlock[Unsafe] to calculate the block signature at build time, and inject it into the call site. This makes block invocations 10-15x faster (I've added tests that asserts at least an 8x increase). It's also required in order to be able to remove the dynamic registrar code in the future (since calculating the block signature at runtime requires the dynamic registrar). * [mtouch/mmp] Add support for reporting errors/warnings that point to the code line causing the error/warning. Add support for reporting errors/warnings that point to the code line causing the error/warning by adding ErrorHelper overloads that take the exact instruction to report (previously we defaulted to the first line/instruction in a method). * [tests] Add support for asserting filename/linenumber in warning messages. * Make all methods that manually create BlockLiterals optimizable. * [tests] Create a BaseOptimizeGeneratedCodeTest test that's included in both XI's and XM's link all test. * [tests] Add link all test (for both XI and XM) to test the BlockLiteral.SetupBlock optimization. * [tests] Add mtouch/mmp tests for the BlockLiteral.SetupBlock optimization. * [tests][linker] Make the base test class abstract, so tests in the base class aren't executed twice. * [tests][linker] Don't execute linkall-only tests in linksdk. The optimization tests only apply when the test assembly is linked, and that only happens in linkall, so exclude those tests in linksdk. * [tests][mmptest] Update test according to mmp changes. Fixes these test failures: 1) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("inline-runtime-arch") The warning 'MM0132: Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output: Message #1 did not match: actual: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.' expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' Message #2 did not match: actual: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.' expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' 2) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("foo") The warning 'MM0132: Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output: Message #1 did not match: actual: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.' expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' Message #2 did not match: actual: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.' expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' * [tests][linker] Fix typo. Fixes this test failure: 1) SetupBlock_CustomDelegate (Linker.Shared.BaseOptimizeGeneratedCodeTest.SetupBlock_CustomDelegate) Counter Expected: 1 But was: 2 * [registrar] Minor adjustment to error message to match previous (and better) behavior. Fixes this test failure: 1) Failed : Xamarin.Registrar.GenericType_WithInvalidParameterTypes The error 'MT4136: The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)'' was not found in the output: Message #1 did not match: actual: 'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<Foundation.NSObject>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)'' expected: 'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)'' * [docs] mmp shows MM errors/warnings. * [docs] Improve according to reviews. * [tests] Fix merge failure causing test duplication.
2018-02-06 09:08:15 +03:00
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.
2018-09-19 18:03:56 +03:00
<a name="MM4174" />
2018-09-19 18:03:56 +03:00
#### 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](https://github.com/xamarin/xamarin-macios/issues/new) with a test case.
[mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. (#4073) * [mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. BlockProxy attributes may have types we don't expect, so handle those cases gracefully by showing a warning when we encounter them: testApp.cs(11): warning MT4175: The parameter 'completionHandler' in the method 'Issue4072Session.CreateDataTask(Foundation.NSUrl,Foundation.NSUrlSessionResponse)' has an invalid BlockProxy attribute (the type passed to the attribute does not have a 'Create' method). instead of an ugly MT0000: MTOUCH : error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00012] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/First.cs:30 at Registrar.StaticRegistrar.GetBlockProxyAttributeMethod (Mono.Cecil.MethodDefinition method, System.Int32 parameter) [0x00020] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4121 at Registrar.StaticRegistrar.GetBlockWrapperCreator (Registrar.Registrar+ObjCMethod obj_method, System.Int32 parameter) [0x00011] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4065 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb, Registrar.Registrar+ObjCMethod method, System.Collections.Generic.List`1[T] exceptions) [0x0216b] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:3683 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb) [0x00f1e] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:2963 Fixes #4072. * [docs] Improve text for MT4175. * [registrar] Comment some code.
2018-05-11 15:42:27 +03:00
2018-09-19 18:03:56 +03:00
<a name="MM4175"/>
[mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. (#4073) * [mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. BlockProxy attributes may have types we don't expect, so handle those cases gracefully by showing a warning when we encounter them: testApp.cs(11): warning MT4175: The parameter 'completionHandler' in the method 'Issue4072Session.CreateDataTask(Foundation.NSUrl,Foundation.NSUrlSessionResponse)' has an invalid BlockProxy attribute (the type passed to the attribute does not have a 'Create' method). instead of an ugly MT0000: MTOUCH : error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00012] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/First.cs:30 at Registrar.StaticRegistrar.GetBlockProxyAttributeMethod (Mono.Cecil.MethodDefinition method, System.Int32 parameter) [0x00020] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4121 at Registrar.StaticRegistrar.GetBlockWrapperCreator (Registrar.Registrar+ObjCMethod obj_method, System.Int32 parameter) [0x00011] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4065 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb, Registrar.Registrar+ObjCMethod method, System.Collections.Generic.List`1[T] exceptions) [0x0216b] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:3683 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb) [0x00f1e] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:2963 Fixes #4072. * [docs] Improve text for MT4175. * [registrar] Comment some code.
2018-05-11 15:42:27 +03:00
2018-09-19 18:03:56 +03:00
### 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).
[mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. (#4073) * [mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. BlockProxy attributes may have types we don't expect, so handle those cases gracefully by showing a warning when we encounter them: testApp.cs(11): warning MT4175: The parameter 'completionHandler' in the method 'Issue4072Session.CreateDataTask(Foundation.NSUrl,Foundation.NSUrlSessionResponse)' has an invalid BlockProxy attribute (the type passed to the attribute does not have a 'Create' method). instead of an ugly MT0000: MTOUCH : error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00012] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/First.cs:30 at Registrar.StaticRegistrar.GetBlockProxyAttributeMethod (Mono.Cecil.MethodDefinition method, System.Int32 parameter) [0x00020] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4121 at Registrar.StaticRegistrar.GetBlockWrapperCreator (Registrar.Registrar+ObjCMethod obj_method, System.Int32 parameter) [0x00011] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4065 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb, Registrar.Registrar+ObjCMethod method, System.Collections.Generic.List`1[T] exceptions) [0x0216b] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:3683 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb) [0x00f1e] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:2963 Fixes #4072. * [docs] Improve text for MT4175. * [registrar] Comment some code.
2018-05-11 15:42:27 +03:00
2018-09-19 18:03:56 +03:00
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:
[mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. (#4073) * [mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. BlockProxy attributes may have types we don't expect, so handle those cases gracefully by showing a warning when we encounter them: testApp.cs(11): warning MT4175: The parameter 'completionHandler' in the method 'Issue4072Session.CreateDataTask(Foundation.NSUrl,Foundation.NSUrlSessionResponse)' has an invalid BlockProxy attribute (the type passed to the attribute does not have a 'Create' method). instead of an ugly MT0000: MTOUCH : error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00012] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/First.cs:30 at Registrar.StaticRegistrar.GetBlockProxyAttributeMethod (Mono.Cecil.MethodDefinition method, System.Int32 parameter) [0x00020] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4121 at Registrar.StaticRegistrar.GetBlockWrapperCreator (Registrar.Registrar+ObjCMethod obj_method, System.Int32 parameter) [0x00011] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4065 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb, Registrar.Registrar+ObjCMethod method, System.Collections.Generic.List`1[T] exceptions) [0x0216b] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:3683 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb) [0x00f1e] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:2963 Fixes #4072. * [docs] Improve text for MT4175. * [registrar] Comment some code.
2018-05-11 15:42:27 +03:00
2018-09-19 18:03:56 +03:00
```csharp
public override NSUrlSessionDataTask CreateDataTask (NSUrl url, [BlockProxy (typeof (UnexpectedType))] NSUrlSessionResponse completionHandler)
{
}
```
[mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. (#4073) * [mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. BlockProxy attributes may have types we don't expect, so handle those cases gracefully by showing a warning when we encounter them: testApp.cs(11): warning MT4175: The parameter 'completionHandler' in the method 'Issue4072Session.CreateDataTask(Foundation.NSUrl,Foundation.NSUrlSessionResponse)' has an invalid BlockProxy attribute (the type passed to the attribute does not have a 'Create' method). instead of an ugly MT0000: MTOUCH : error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00012] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/First.cs:30 at Registrar.StaticRegistrar.GetBlockProxyAttributeMethod (Mono.Cecil.MethodDefinition method, System.Int32 parameter) [0x00020] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4121 at Registrar.StaticRegistrar.GetBlockWrapperCreator (Registrar.Registrar+ObjCMethod obj_method, System.Int32 parameter) [0x00011] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4065 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb, Registrar.Registrar+ObjCMethod method, System.Collections.Generic.List`1[T] exceptions) [0x0216b] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:3683 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb) [0x00f1e] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:2963 Fixes #4072. * [docs] Improve text for MT4175. * [registrar] Comment some code.
2018-05-11 15:42:27 +03:00
2018-09-19 18:03:56 +03:00
Any `[BlockProxy]` attributes with invalid types will be ignored.
[mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. (#4073) * [mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. BlockProxy attributes may have types we don't expect, so handle those cases gracefully by showing a warning when we encounter them: testApp.cs(11): warning MT4175: The parameter 'completionHandler' in the method 'Issue4072Session.CreateDataTask(Foundation.NSUrl,Foundation.NSUrlSessionResponse)' has an invalid BlockProxy attribute (the type passed to the attribute does not have a 'Create' method). instead of an ugly MT0000: MTOUCH : error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00012] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/First.cs:30 at Registrar.StaticRegistrar.GetBlockProxyAttributeMethod (Mono.Cecil.MethodDefinition method, System.Int32 parameter) [0x00020] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4121 at Registrar.StaticRegistrar.GetBlockWrapperCreator (Registrar.Registrar+ObjCMethod obj_method, System.Int32 parameter) [0x00011] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4065 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb, Registrar.Registrar+ObjCMethod method, System.Collections.Generic.List`1[T] exceptions) [0x0216b] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:3683 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb) [0x00f1e] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:2963 Fixes #4072. * [docs] Improve text for MT4175. * [registrar] Comment some code.
2018-05-11 15:42:27 +03:00
2018-09-19 18:03:56 +03:00
This also means that removing the attribute will fix the warning:
[mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. (#4073) * [mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. BlockProxy attributes may have types we don't expect, so handle those cases gracefully by showing a warning when we encounter them: testApp.cs(11): warning MT4175: The parameter 'completionHandler' in the method 'Issue4072Session.CreateDataTask(Foundation.NSUrl,Foundation.NSUrlSessionResponse)' has an invalid BlockProxy attribute (the type passed to the attribute does not have a 'Create' method). instead of an ugly MT0000: MTOUCH : error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00012] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/First.cs:30 at Registrar.StaticRegistrar.GetBlockProxyAttributeMethod (Mono.Cecil.MethodDefinition method, System.Int32 parameter) [0x00020] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4121 at Registrar.StaticRegistrar.GetBlockWrapperCreator (Registrar.Registrar+ObjCMethod obj_method, System.Int32 parameter) [0x00011] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4065 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb, Registrar.Registrar+ObjCMethod method, System.Collections.Generic.List`1[T] exceptions) [0x0216b] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:3683 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb) [0x00f1e] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:2963 Fixes #4072. * [docs] Improve text for MT4175. * [registrar] Comment some code.
2018-05-11 15:42:27 +03:00
2018-09-19 18:03:56 +03:00
```csharp
public override NSUrlSessionDataTask CreateDataTask (NSUrl url, NSUrlSessionResponse completionHandler)
{
}
```
[mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. (#4073) * [mtouch/mmp] Handle invalid types in BlockProxy attributes better. Fixes #4072. BlockProxy attributes may have types we don't expect, so handle those cases gracefully by showing a warning when we encounter them: testApp.cs(11): warning MT4175: The parameter 'completionHandler' in the method 'Issue4072Session.CreateDataTask(Foundation.NSUrl,Foundation.NSUrlSessionResponse)' has an invalid BlockProxy attribute (the type passed to the attribute does not have a 'Create' method). instead of an ugly MT0000: MTOUCH : error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00012] in /Users/builder/jenkins/workspace/build-package-osx-mono/2017-12/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/First.cs:30 at Registrar.StaticRegistrar.GetBlockProxyAttributeMethod (Mono.Cecil.MethodDefinition method, System.Int32 parameter) [0x00020] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4121 at Registrar.StaticRegistrar.GetBlockWrapperCreator (Registrar.Registrar+ObjCMethod obj_method, System.Int32 parameter) [0x00011] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:4065 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb, Registrar.Registrar+ObjCMethod method, System.Collections.Generic.List`1[T] exceptions) [0x0216b] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:3683 at Registrar.StaticRegistrar.Specialize (Registrar.AutoIndentStringBuilder sb) [0x00f1e] in /Users/builder/data/lanes/5944/7e782c1e/source/xamarin-macios/tools/common/StaticRegistrar.cs:2963 Fixes #4072. * [docs] Improve text for MT4175. * [registrar] Comment some code.
2018-05-11 15:42:27 +03:00
2018-09-19 18:03:56 +03:00
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 <a href="#MM4174">MM4174</a> warning
will be shown.
Reference: https://github.com/xamarin/xamarin-macios/issues/4072
<a name="MM4176"/>
### 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](https://github.com/xamarin/xamarin-macios/issues/new) with a test case.
<!-- 4178: used by mtouch -->
### 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](https://github.com/xamarin/xamarin-macios/issues/new), if it's a
third-party binding, please contact the vendor.
2018-09-19 18:03:56 +03:00
## MM5xxx: GCC and toolchain
### MM51xx: compilation
<a name="MM5101" />
#### MM5101: Missing '{0}' compiler. Please install Xcode 'Command-Line Tools' component.
<!-- 5102 used by mtouch -->
<a name="MM5103" />
#### MM5103: Failed to compile. Error code - {0}. Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
2018-09-19 18:03:56 +03:00
### MM52xx: linking
<a name="MM5202" />
#### MM5202: Mono.framework MDK is missing. Please install the MDK for your Mono.framework version from http://mono-project.com/Downloads
<a name="MM5203" />
#### MM5203: Can't find libxammac.a, likely because of a corrupted Xamarin.Mac installation. Please reinstall Xamarin.Mac.
<a name="MM5204" />
#### MM5204: Invalid architecture. x86_64 is only supported on non-Classic profiles.
<a name="MM5205" />
#### MM5205: Invalid architecture '{0}'. Valid architectures are i386 and x86_64 (when --profile=mobile).
<a name="MM5218" />
<!-- 5107 is used by mtouch-->
<!-- 5108 is used by mtouch-->
#### MM5218: Can't ignore the dynamic symbol {symbol} (--ignore-dynamic-symbol={symbol}) because it was not detected as a dynamic symbol.
[mtouch] Improve how we make sure native symbols aren't stripped away. Fixes #51710 and #54417. (#2162) * [mtouch] Improve how we make sure native symbols aren't stripped away. Fixes #51710 and #54417. * Refactor required symbol collection to store more information about each symbol (field, function, Objective-C class), and in general make the code more straight forward. * Implement support for generating source code that references these symbols, and do this whenever we can't ask the native linker to keep these symbols (when using bitcode). Additionally make it possible to do this manually, so that the source code can be generated for non-bitcode platforms too (which is useful if the number of symbols is enormous, in which case we might surpass the maximum command-line length). * Also make it possible to completely ignore native symbols, or ignore them on a per-symbol basis. This provides a fallback for users if we get something right and we try to preserve something that shouldn't be preserved (for instance if it doesn't exist), and the user ends up with unfixable linker errors. * Don't collect Objective-C classes unless they're in an assembly with LinkWith attributes. We don't need to preserve Objective-C classes in any other circumstances. * Implement everything for both Xamarin.iOS and Xamarin.Mac, and share the code between them. * Remove previous workaround for bug #51710, since it's no longer needed. * Add tests. https://bugzilla.xamarin.com/show_bug.cgi?id=54417 https://bugzilla.xamarin.com/show_bug.cgi?id=51710 * [mtouch] Make sure to only keep symbols from the current app when code sharing. This fixes a build problem with the interdependent-binding-projects test when testing in Today Extension mode.
2017-06-02 19:29:19 +03:00
See the [equivalent mtouch warning](~/ios/troubleshooting/mtouch-errors.md#MT5218).
[mtouch] Improve how we make sure native symbols aren't stripped away. Fixes #51710 and #54417. (#2162) * [mtouch] Improve how we make sure native symbols aren't stripped away. Fixes #51710 and #54417. * Refactor required symbol collection to store more information about each symbol (field, function, Objective-C class), and in general make the code more straight forward. * Implement support for generating source code that references these symbols, and do this whenever we can't ask the native linker to keep these symbols (when using bitcode). Additionally make it possible to do this manually, so that the source code can be generated for non-bitcode platforms too (which is useful if the number of symbols is enormous, in which case we might surpass the maximum command-line length). * Also make it possible to completely ignore native symbols, or ignore them on a per-symbol basis. This provides a fallback for users if we get something right and we try to preserve something that shouldn't be preserved (for instance if it doesn't exist), and the user ends up with unfixable linker errors. * Don't collect Objective-C classes unless they're in an assembly with LinkWith attributes. We don't need to preserve Objective-C classes in any other circumstances. * Implement everything for both Xamarin.iOS and Xamarin.Mac, and share the code between them. * Remove previous workaround for bug #51710, since it's no longer needed. * Add tests. https://bugzilla.xamarin.com/show_bug.cgi?id=54417 https://bugzilla.xamarin.com/show_bug.cgi?id=51710 * [mtouch] Make sure to only keep symbols from the current app when code sharing. This fixes a build problem with the interdependent-binding-projects test when testing in Today Extension mode.
2017-06-02 19:29:19 +03:00
### 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.
<!-- 5206 used by mtouch -->
<!-- 5207 used by mtouch -->
<!-- 5208 used by mtouch -->
<!-- 5209 used by mtouch -->
<!-- 5210 used by mtouch -->
<!-- 5211 used by mtouch -->
<!-- 5212 used by mtouch -->
<!-- 5213 used by mtouch -->
<!-- 5214 used by mtouch -->
<!-- 5215 used by mtouch -->
[mtouch] Improve how we make sure native symbols aren't stripped away. Fixes #51710 and #54417. (#2162) * [mtouch] Improve how we make sure native symbols aren't stripped away. Fixes #51710 and #54417. * Refactor required symbol collection to store more information about each symbol (field, function, Objective-C class), and in general make the code more straight forward. * Implement support for generating source code that references these symbols, and do this whenever we can't ask the native linker to keep these symbols (when using bitcode). Additionally make it possible to do this manually, so that the source code can be generated for non-bitcode platforms too (which is useful if the number of symbols is enormous, in which case we might surpass the maximum command-line length). * Also make it possible to completely ignore native symbols, or ignore them on a per-symbol basis. This provides a fallback for users if we get something right and we try to preserve something that shouldn't be preserved (for instance if it doesn't exist), and the user ends up with unfixable linker errors. * Don't collect Objective-C classes unless they're in an assembly with LinkWith attributes. We don't need to preserve Objective-C classes in any other circumstances. * Implement everything for both Xamarin.iOS and Xamarin.Mac, and share the code between them. * Remove previous workaround for bug #51710, since it's no longer needed. * Add tests. https://bugzilla.xamarin.com/show_bug.cgi?id=54417 https://bugzilla.xamarin.com/show_bug.cgi?id=51710 * [mtouch] Make sure to only keep symbols from the current app when code sharing. This fixes a build problem with the interdependent-binding-projects test when testing in Today Extension mode.
2017-06-02 19:29:19 +03:00
<!-- 5216 used by mtouch -->
<!-- 5217 used by mtouch -->
<!-- 5218 used by mtouch -->
<a name="MT5220" />
#### 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.
<a name="MM5221" />
#### 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
<!-- 5301 used by mtouch -->
<!-- 5302 used by mtouch -->
<!-- 5303 used by mtouch -->
<!-- 5304 used by mtouch -->
<a name="MM5305" />
#### MM5305: Missing 'otool' tool. Please install Xcode 'Command-Line Tools' component
<a name="MM5306" />
#### MM5306: Missing dependencies. Please install Xcode 'Command-Line Tools' component
<a name="MM5308" />
#### MM5308: Xcode license agreement may not have been accepted. Please launch Xcode.
<a name="MM5309" />
#### MM5309: Native linking failed with error code 1. Check build log for details.
<a name="MM5310" />
#### MM5310: install_name_tool failed with an error code '{0}'. Check build log for details.
<a name="MM5311" />
#### MM5311: lipo failed with an error code '{0}'. Check build log for details.
<a name="MM5312" />
### MM5312: pkg-config failed with an error code '{code}'. Check build log for details.
<a name="MM5313" />
### MM5313: Could not find pkg-config. Please install the Mono.framework from https://mono-project.com/Downloads
<a name="MM5314" />
### MM5314: Failed to execute pkg-config: '{0}'. Check build log for details.
<!-- MM6xxx: mmp internal tools -->
<!-- MM7xxx: reserved -->
## MM8xxx: runtime
### MM800x: misc
<!-- 8000 used by mtouch -->
<!-- 8001 used by mtouch -->
<!-- 8002 used by mtouch -->
<!-- 8003 used by mtouch -->
<!-- 8004 used by mtouch -->
<!-- 8005 used by mtouch -->
<!-- 8006 used by mtouch -->
<!-- 8007 used by mtouch -->
<!-- 8008 used by mtouch -->
<!-- 8009 used by mtouch -->
<!-- 8010 used by mtouch -->
<!-- 8011 used by mtouch -->
<!-- 8012 used by mtouch -->
<!-- 8013 used by mtouch -->
<!-- 8014 used by mtouch -->
<!-- 8015 used by mtouch -->
<!-- 8016 used by mtouch -->
<a name="MM8017" />
#### MM8017: The Boehm garbage collector is not supported. Please use SGen instead.
<a name="MM8025" />
#### 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](https://github.com/xamarin/xamarin-macios/issues/new).
2018-02-14 03:37:47 +03:00
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.
<a name="MM8026" />
#### 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](https://github.com/xamarin/xamarin-macios/issues/new).
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.
<a name="MT8027" />
### 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:
* 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 report](https://github.com/xamarin/xamarin-macios/issues/new).
<a name="MM8028" />
### 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](https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions).
<a name="MM8029" />
### 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](https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions).
<a name="MM8030" />
### 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](https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions).
<a name="MM8031" />
### 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](https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions).
<a name="MM8032" />
### 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](https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions).
<a name="MM8033" />
### 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](https://github.com/xamarin/xamarin-macios/wiki/Submitting-Bugs-&-Suggestions).
<a name="MM8034" />
### MM8034: Failed to lookup the required marshalling information.
This exception will have an inner exception which gives the reason for the failure.
<a name="MM8035" />
### 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.
<a name="MM8036" />
### MM8036: Failed to marshal the value at index {index}.
This exception will have an inner exception which gives the reason for the failure.