xamarin-macios/tools/mmp/error.cs

149 строки
7.8 KiB
C#
Исходник Обычный вид История

2016-04-21 15:57:02 +03:00
// copied from MonoTouch mtouch code
// Copyright 2011-2013, Xamarin Inc. All rights reserved,
using System;
using System.Collections.Generic;
namespace Xamarin.Bundler {
// Error allocation
// as far as possible the error # is shared with MonoTouch
//
// MM0xxx mmp itself, e.g. parameters, environment (e.g. missing tools)
// MM0000 Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
// 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}'
// MM0010 Could not parse the command line arguments: {0}
// MM0013 <unused>
// 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}'.
// MT0023 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=<path>
// 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}.
// MM0079 Internal Error - No executable was copied into the app bundle. Please contact 'support@xamarin.com'
// Warning MT0080 Disabling NewRefCount, --new-refcount:false, is deprecated.
// MM0088 ** Reserved mtouch **
// MM0089 ** Reserved mtouch **
// MM0097 machine.config file '{0}' can not be found.
2016-04-21 15:57:02 +03:00
// MM1xxx file copy / symlinks (project related)
// 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.
// MM15xx Assembly gathering (not requiring linker) errors
// MM1501 Can not resolve reference: {0}
// MT16xx 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, legacy or appletls
// MM2012 Only first {0} of {1} "Referenced by" warnings shown. ** This message related to 2009 **
// Warning MM2013 Failed to resolve the reference to "{0}", referenced in "{1}". The app will not include the referenced assembly, and may fail at runtime.
// Warning MT2014 Xamarin.Mac Extensions do not support linking. Request for linking will be ignored.
[mtouch][linker] Provide a more specific error code when OptimizeGeneratedCodeSubStep fails (#903) The MT2001 error is a general, something went bad, in the linker code base. The stack trace is often enough to track down issues but in some cases it would be easier to ask customers for a specific assembly (rather than their complete project) to investigate an issue. Example: error MT2103: Binding Optimizer failed processing `System.Void GoogleConversionTracking.Unified.GoogleConversionPing::.ctor()`. --- inner exception System.NullReferenceException: Object reference not set to an instance of an object at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.ProcessIsDirectBinding (Mono.Cecil.MethodDefinition caller, Mono.Cecil.Cil.Instruction ins) [0x00026] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:264 at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.ProcessCalls (Mono.Cecil.MethodDefinition caller, Int32 i) [0x00337] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:197 at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.Process (Mono.Cecil.MethodDefinition method) [0x0007b] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:81 at Xamarin.Linker.StateSubStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00004] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/CoreOptimizeGeneratedCode.cs:48 --- at Xamarin.Linker.StateSubStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00014] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/CoreOptimizeGeneratedCode.cs:50 at Mono.Tuner.SubStepDispatcher.DispatchMethod (Mono.Cecil.MethodDefinition method) [0x0001d] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:215 at Mono.Tuner.SubStepDispatcher.BrowseMethods (ICollection methods) [0x0001c] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:167 at Mono.Tuner.SubStepDispatcher.BrowseTypes (ICollection types) [0x0006b] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:145 at Mono.Tuner.SubStepDispatcher.BrowseAssemblies (IEnumerable`1 assemblies) [0x00050] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:123 at Mono.Tuner.SubStepDispatcher.Process (Mono.Linker.LinkContext context) [0x0000f] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:104 at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00027] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/linker/Mono.Linker/Pipeline.cs:118 at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List`1& assemblies) [0x000ac] in /Users/poupou/git/xamarin/xamarin-macios/tools/mtouch/Tuning.cs:79 Right now the MT2001 would only include the inner exception, which does not include any clue to which assembly caused the exception. Note: The same pattern to be applied to other BaseSubStep subclasses in separate commits. Related to (but not the fix for) https://bugzilla.xamarin.com/show_bug.cgi?id=44701
2016-09-28 18:46:14 +03:00
// MM202x Binding Optimizer failed processing `...`.
2016-04-21 15:57:02 +03:00
// MM4xxx code generation
// MM40xx driver.m
// MM4001 The main template could not be expansed to `{0}`.
// 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 with the mobile profile.
// MM5205 Invalid architecture '{0}'. Valid architectures are i386 and x86_64 (when --profile=mobile).
// MM5206 ** reserved mtouch **
// MM5207 ** reserved mtouch **
// MM5208 ** reserved mtouch **
// MM5209 ** reserved mtouch **
// MM5210 ** reserved mtouch **
// MM5211 ** reserved mtouch **
// MM5212 ** reserved mtouch **
// MM5213 ** reserved mtouch **
// MM5214 ** reserved mtouch **
// MM5215 ** reserved mtouch **
// MM53xx other tools
// MM5301 pkg-config could not be found. Please install the Mono.framework from http://mono-project.com/Downloads
// MM5302 ** reserved mtouch **
// MM5303 ** reserved mtouch **
// MM5304 ** reserved mtouch **
// 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.
// MT5310 install_name_tool failed with an error code '{0}'. Check build log for details.
2016-04-21 15:57:02 +03:00
// MM6xxx mmp internal tools
// MM7xxx reserved
// MM8xxx runtime
// MM800x misc
// MM8000 - MM8016 ** reserved mtouch **
// MM8017 The Boehm garbage collector is not supported. Please use SGen instead.
// MM9xxx Licensing
public class MonoMacException : Exception {
public MonoMacException (int code, string message, params object[] args) :
this (code, false, message, args)
{
}
public MonoMacException (int code, bool error, string message, params object[] args) :
this (code, error, null, message, args)
{
}
public MonoMacException (int code, bool error, Exception innerException, string message, params object[] args) :
base (String.Format (message, args), innerException)
{
Code = code;
Error = error;
}
public string FileName { get; set; }
public int LineNumber { get; set; }
public int Code { get; private set; }
public bool Error { get; private set; }
// http://blogs.msdn.com/b/msbuild/archive/2006/11/03/msbuild-visual-studio-aware-error-messages-and-message-formats.aspx
public override string ToString ()
{
if (string.IsNullOrEmpty (FileName)) {
return String.Format ("{0} MM{1:0000}: {2}", Error ? "error" : "warning", Code, Message);
} else {
return String.Format ("{3}({4}): {0} MM{1:0000}: {2}", Error ? "error" : "warning", Code, Message, FileName, LineNumber);
}
}
}
}