Bug 10959 - While compiling for iPhone deployment, I get the following error
Summary: While compiling for iPhone deployment, I get the following error
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 6.2.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-03-07 04:37 UTC by web
Modified: 2013-03-08 08:59 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description web 2013-03-07 04:37:55 UTC
Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Applications/Xcode.app/Contents/Developer" -v --cache "/Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/obj/Debug/mtouch-cache" --nomanifest --nosign -dev "/Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app" -r "/Volumes/Allgemein/Entwicklung/CSharp/WF.Player/Core/bin/iPhone/Debug/Core.dll" -r "/Volumes/Allgemein/Entwicklung/CSharp/WF.Player/KopiLua/Core/LuaInterface/bin/iPhone/Debug/LuaInterface.IOS.dll" -r "/Volumes/Allgemein/Entwicklung/CSharp/WF.Player/KopiLua/Core/KopiLua/bin/iPhone/Debug/KopiLua.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" --crashreporting-api-key: -debug -sdk "6.1" -targetver "4.3" --abi=armv7,armv7s "/Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.exe"
MonoTouch Business version 6.2.0 using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
Copied /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.exe to /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app/iPhone.exe
Copied /Developer/MonoTouch/usr/lib/mono/2.1/mscorlib.dll to /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app/mscorlib.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll to /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app/monotouch.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll to /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app/System.Core.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.dll to /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app/System.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/Mono.Security.dll to /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app/Mono.Security.dll
Copied /Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll to /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app/System.Xml.dll
Copied /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/Core/bin/iPhone/Debug/Core.dll to /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app/Core.dll
Copied /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/KopiLua/Core/LuaInterface/bin/iPhone/Debug/LuaInterface.IOS.dll to /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app/LuaInterface.IOS.dll
Copied /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/KopiLua/Core/KopiLua/bin/iPhone/Debug/KopiLua.dll to /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app/KopiLua.dll
Linking assembly /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.exe into /Volumes/Allgemein/Entwicklung/CSharp/WF.Player/iPhone/bin/iPhone/Debug/iPhone.app
error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
System.NullReferenceException: Object reference not set to an instance of an object
  at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, Mono.Linker.LinkContext& context, System.Collections.Generic.List`1& assemblies) [0x00000] in <filename unknown>:0 
  at MTouch.LinkAssemblies (System.String main, System.Collections.Generic.List`1& assemblies, Boolean include_debug_info) [0x00000] in <filename unknown>:0 
  at MTouch.Main2 (System.String[] args) [0x00000] in <filename unknown>:0 
  at MTouch.Main (System.String[] args) [0x00000] in <filename unknown>:0
Comment 1 Sebastien Pouliot 2013-03-07 08:30:05 UTC
There's a bug in 6.2 (fixed in the upcoming 6.2.1) that throw this error when it tries to report a missing type.

That condition often occurs when one of the assemblies was compiled against a "full" framework assemblies (e.g. mscorlib.dll from MS.NET) and the linker cannot find the same type in the (Silverlight-based profile) of Xamarin.iOS's mscorlib.

Can you zip and attach* every .dll (except the ones shipped with our product) ?  Using this I should be able to tell you what went wrong.

* You can mark the attachment as private.
Comment 3 web 2013-03-07 09:26:52 UTC
I'm not very firm in this thing, so I sent you the whole project, so you could check it. Hope this helps.

Thank you very much for your help.

Best regards,
Dirk Weltz
Comment 4 Sebastien Pouliot 2013-03-07 14:50:13 UTC
I think there's something wrong with the ZIP file (tried twice on different macs). I only get some files out of it (and nowhere near the 4.2MB of the archive size) and another tools complains about it (and does not extract).

Could you check the archive on your side (or recreate it) ? it might have been broke on upload. thanks
Comment 6 web 2013-03-07 15:56:58 UTC
Could be a problem, because I uploaded the file with auto-detect. Sorry for problems.
Comment 7 Sebastien Pouliot 2013-03-08 08:51:27 UTC
The correct error (that 6.2.1 will report) is:

error MT2002: Failed to resolve "System.Reflection.Emit.TypeBuilder" reference from "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"

and this type is being referenced by LuaInterface.IOS.dll from the source file:

./KopiLua/Core/LuaInterface/GenerateEventAssembly/CodeGeneration.cs

Because of Apple restrictions (against JIT'ing) Xamarin.iOS cannot use System.Reflection.Emit. You'll need to #if-def out those part of your code to allow it to build (and run) for iOS devices.
Comment 8 web 2013-03-08 08:59:14 UTC
Thank you very much for your fast answer.