Bug 17589 - Problem to compile on iPad
Summary: Problem to compile on iPad
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 7.0.7
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: 7.2.1
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2014-02-04 05:36 UTC by Alain
Modified: 2014-05-13 11:50 UTC (History)
5 users (show)

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


Attachments
Log Error AOT (449.36 KB, text/rtf)
2014-02-05 03:14 UTC, Alain
Details
DLL KMEHRLIB (464.50 KB, application/octet-stream)
2014-02-21 09:53 UTC, Alain
Details
TranslationLib.dll with KmerhLib.dll (22.50 KB, application/octet-stream)
2014-02-21 14:52 UTC, Alain
Details


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 Alain 2014-02-04 05:36:35 UTC
Hi, 

I have a big problem hone I put my application on iPad.

I have this error and I can't quite to put my application on the iPad. Can you tell me what should I do ?

Error MT3001: Could not AOT the assembly '/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/Build/KmehrLib.dll' (MT3001)

Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Applications/Xcode.app/Contents/Developer" --cache "/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache" --nomanifest --nosign -dev "/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/bin/iPhone/Debug/MedinectIPad.app" -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" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Web.Services.dll" -r "/Users/RogisterMAC/Projects/DLLMedinect/DLLMedinect/GlobalTools.dll" -r "/Users/RogisterMAC/Projects/DLLMedinect/DLLMedinect/ZipArchive.dll" -r "/Users/RogisterMAC/Projects/DLLMedinect/DLLMedinect/ActionTray.dll" -r "/Users/RogisterMAC/Projects/DLLMedinect/DLLMedinect/BTProgressHUD.dll" -r "/Users/RogisterMAC/Projects/DLLMedinect/DLLMedinect/bin/Debug/DLLMedinect.dll" -r "/Users/RogisterMAC/Projects/Freedelity/Freedelity/bin/Release/Freedelity.dll" -debug "-i18n=west" -sdk "7.0" -targetver "6.1" --abi=armv7 "/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/bin/iPhone/Debug/MedinectIPad.exe"
Xamarin.iOS 7.0.6 Business Edition using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk
warning MT3005: The dependency 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'DLLMedinect, Version=1.0.5148.20014, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'DLLMedinect, Version=1.0.5148.20014, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'DLLMedinect, Version=1.0.5148.20014, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'DLLMedinect, Version=1.0.5148.20014, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'GlobalTools, Version=1.0.17.13, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'GlobalTools, Version=1.0.17.13, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'StructuresLib, Version=1.0.0.4, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'GlobalTools, Version=1.0.17.13, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'GlobalTools, Version=1.0.17.13, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'GlobalTools, Version=1.0.17.13, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' of the assembly 'DLLMedinect, Version=1.0.5148.20014, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'KmehrLib, Version=1.0.13.6, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'KmehrLib, Version=1.0.13.6, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'TranslationLib, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'LaboLib, Version=1.0.2.1, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'KmehrLib, Version=1.0.13.4, Culture=neutral, PublicKeyToken=null' of the assembly 'LaboLib, Version=1.0.2.1, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' was not found. Please review the project's references.
warning MT3005: The dependency 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' was not found. Please review the project's references.
warning MT3006: Could not compute a complete dependency map for the project. This will result in slower build times because Xamarin.iOS can't properly detect what needs to be rebuilt (and what does not need to be rebuilt). Please review previous warnings for more details.
AOT Compilation exited with code 134, command:
MONO_PATH=/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/Build /Developer/MonoTouch/usr/bin/arm-darwin-mono-boehm --debug -O=gsharedvt  --aot=mtriple=armv7-ios,full,static,asmonly,direct-icalls,soft-debug,dwarfdebug,no-direct-calls,iphone-abi,outfile=/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/KmehrLib.dll.armv7.s "/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/Build/KmehrLib.dll"
Mono Ahead of Time compiler - compiling assembly /Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/Build/KmehrLib.dll
wrong maximal instruction length of instruction endfinally (expected 20, got 24)
* Assertion: should not be reached at ../../../../../mono/mono/mini/mini-arm.c:5243


error MT3001: Could not AOT the assembly '/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/Build/KmehrLib.dll'

---------------------- Fini ----------------------

Project does not have bundle identifier specified. Generated 'medinectipad' to match provisioning profile.
Construire : 1 erreur, 139 avertissements
Comment 1 Prashant manu 2014-02-04 06:59:30 UTC
Could you please provide us the Test sample/steps so that we can verify this at our end?
Comment 2 Alain 2014-02-04 07:34:26 UTC
Sorry, but what do you want exactly ?
Comment 3 Alain 2014-02-04 13:22:04 UTC
Hi, 

I try to compile my project with LLVM. Not success

I Try to compile my project with Don't Link and I have this error :

Mono Ahead of Time compiler - compiling assembly /Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/Build/mscorlib.dll
Executing opt: /Developer/MonoTouch/LLVM/bin/opt -f -targetlibinfo -no-aa -basicaa -notti -instcombine -simplifycfg -sroa -domtree -early-cse -lazy-value-info -correlated-propagation -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -indvars -loop-idiom -loop-deletion -loop-unroll -memdep -gvn -memdep -memcpyopt -sccp -instcombine -lazy-value-info -correlated-propagation -domtree -memdep -dse -adce -simplifycfg -instcombine -strip-dead-prototypes -preverify -domtree -verify -o "/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.armv7.s.opt.bc" "/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.armv7.s.bc"
Executing llc: /Developer//Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -Qunused-arguments -miphoneos-version-min=6.1 -c -o /Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.armv7.o -x assembler /Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.armv7.s
MonoTouch/LLVM/bin/llc  -mattr=+vfp2,-neon,+d16 -asm-verbose=false -mtriple=armv7-ios -relocation-model=pic -disable-gnu-eh-frame -enable-mono-eh-frame -o "/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.armv7.s" "/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.armv7.s.opt.bc"
Code: 1292372 Info: 98018 Ex Info: 549020 Unwind Info: 8680 Class Info: 71040 PLT: 12983 GOT Info: 299386 GOT: 76144 Offsets: 98952
Compiled: 21186/21191 (99%), LLVM: 17320 (81%), No GOT slots: 13786 (65%), Direct calls: 9969 (133%)
5 methods are generic (0%)
Output file: '/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/mscorlib.dll.armv7.s'.
Linking symbol: '_mono_aot_module_mscorlib_info'.
JIT time: 3873 ms, Generation time: 40730 ms, Assembly+Link time: 0 ms.

error MT3001: Could not AOT the assembly '/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/Build/KmehrLib.dll'
  at MonoTouch.AOTTask.Build () [0x00000] in <filename unknown>:0 
  at MonoTouch.BuildTask.Execute () [0x00000] in <filename unknown>:0 
  at MonoTouch.Application.<Compile>m__1A (MonoTouch.BuildTask v) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey55`1[MonoTouch.BuildTask].<>m__55 (MonoTouch.BuildTask e, System.Threading.Tasks.ParallelLoopState s, System.Object l) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey54`2[MonoTouch.BuildTask,System.Object].<>m__53 () [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.TaskActionInvoker+ActionInvoke.Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0


Please, what must I do to resolve this problem ?
Comment 4 Sebastien Pouliot 2014-02-04 22:56:09 UTC
We'll need the full build log (you can attach it to the bug report and mark it private if needed). 

The one above is partial and (because AOT'ing is done in parallel) does not show how KmehrLib.dll was built (only that the AOT compiler did not succeed).

To be useful please add "-v -v -v -v" to your Additional mtouch arguments inside your project's options (if not already enabled). That will ensure we get the maximum of details in the log file.
Comment 5 Alain 2014-02-05 03:14:30 UTC
Created attachment 5975 [details]
Log Error AOT

Kmehr.dll was done on Visual Studio but for now, it is not a portable class library. Do you think the problem may be here?
Comment 6 Sebastien Pouliot 2014-02-05 10:27:10 UTC
> Do you think the problem may be here?

It could be if that assembly reference symbols that do not exists in the BCL that is shipped with Xamarin.iOS.

To avoid this possibility you do not need a PCL (it's one option we added recently) but you must compile that assembly against the SDK we ship (not the regular framework).


From your log the exact error is:

Mono Ahead of Time compiler - compiling assembly /Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/Build/KmehrLib.dll
wrong maximal instruction length of instruction endfinally (expected 20, got 24)
* Assertion: should not be reached at ../../../../../mono/mono/mini/mini-arm.c:5243


This is not how "missing reference" generally report errors. c.c. Zoltan
Comment 7 Alain 2014-02-05 10:38:10 UTC
Hi,

you say : "you must compile that assembly against the SDK we ship"

How can we compile our assembly with your framework? 

We are working on Visual Studio for this assembly on PC and we installed Xamarin IOS. 

Can you compile with Xamarin framework without a PCL?

Thanks

Alain
Comment 8 Zoltan Varga 2014-02-05 11:38:28 UTC
The mini-arm.c assertion is fixed in mono f97bc9e4914d0f25cece04d0505d6e7f5fa06e1f/mt 7e7677d03b27c755f41b7afac74c07c3a5bb81b1.
Comment 9 Alain 2014-02-05 11:56:54 UTC
Hi Zoltan,

you say that mini-arm.c is fixed.

Can you send me the correction because we can no longer put our app on the iPad for our tests and it becomes really urgent. 

thank you 

Alain
Comment 10 Zoltan Varga 2014-02-05 12:04:23 UTC
Spouliot ?
Comment 11 Sebastien Pouliot 2014-02-05 19:53:04 UTC
Alain, the fix was made today and there's no public build(s),  even alpha, that contains it at the moment.

A development-snapshot could be used to confirm that the issue is (totally) fixed - but since there would not have been any QA done for it (and earlier fixes) it should _not_ be used for production (or to develop code nearing production status). IOW a untested snapshot can contain regressions.

Zoltan is there any workaround for this ? i.e. why does this works in so many cases (endfinally) but fails in this specific situation ?
Comment 12 Zoltan Varga 2014-02-06 02:50:03 UTC
The problem happens when  a method is too large and it has too many local variables etc. Splitting it into smaller methods would probably fix the problem.
Comment 13 Alain 2014-02-07 03:10:21 UTC
Hi,

We had 2 big methods over 1000 lines and we cut this method into smaller methods. 

We tried it and now it works again. 

But please, I hope your fix works because it isn't really normal that we should be concerned about that. 

But a big thank you for your help. 

Alain
Comment 14 Sebastien Pouliot 2014-02-07 08:51:33 UTC
Alain, can you share the binary Kmehr.dll that failed on 7.0.6 ? (you can attach it to the bug and mark is as private)

I'll give it to QA so they can confirm it's fixed and try to fast track the fix into the next (hotfix) release.
Comment 19 Alain 2014-02-07 09:43:52 UTC
Sebastien,

I posted the files that you want.

Thanks for your help.

Alain
Comment 20 Alain 2014-02-21 09:35:50 UTC
Hi,

I come back for the same problem.

I send you the log file. Please help me.

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang  -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -Qunused-arguments -miphoneos-version-min=6.1 -c -o /Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/DLLMedinect.dll.armv7.o -x assembler /Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/DLLMedinect.dll.armv7.s
error MT3001: Could not AOT the assembly '/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/Build/KmehrLib.dll'
  at MonoTouch.AOTTask.Build () [0x00000] in <filename unknown>:0 
  at MonoTouch.BuildTask.Execute () [0x00000] in <filename unknown>:0 
  at MonoTouch.Application.<Compile>m__1 (MonoTouch.BuildTask v) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey6`1[MonoTouch.BuildTask].<>m__0 (MonoTouch.BuildTask e, System.Threading.Tasks.ParallelLoopState s, System.Object l) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey5`2[MonoTouch.BuildTask,System.Object].<>m__0 () [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.TaskActionInvoker+ActionInvoke.Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0 

---------------------- Fini ----------------------

Project does not have bundle identifier specified. Generated 'medinectipad' to match provisioning profile.
Construire : 2 erreurs, 169 avertissements
Comment 21 Zoltan Varga 2014-02-21 09:44:28 UTC
The problem is probably the same, some method is too large and it exposes a bug in the AOT compiler.
Comment 22 Alain 2014-02-21 09:47:45 UTC
The big method in this DLL is 500 lines, 480 and 370 lines.

I put the version IOS 7.0.7 and before, I had 7.0.6. 

Is that the problem may be there too ?
Comment 23 Zoltan Varga 2014-02-21 09:50:11 UTC
I don't think 7.0.7 contains the fix to this problem.
Could you attach the '/Users/RogisterMAC/Projects/Medinect-IPad/Medinect-IPad/obj/iPhone/Debug/mtouch-cache/Build/KmehrLib.dll' file ?
Comment 24 Sebastien Pouliot 2014-02-21 09:52:37 UTC
Not that this fix was not part of the 7.0.7 hotfix release (see release notes [1]). It will be part of the next maintenance release.

[1] http://docs.xamarin.com/releases/ios/xamarin.ios_7/xamarin.ios_7.0/#7
Comment 25 Alain 2014-02-21 09:53:17 UTC
Created attachment 6110 [details]
DLL KMEHRLIB
Comment 26 Alain 2014-02-21 09:55:19 UTC
Yes, but we have a demonstration Tuesday and it should definitely work on the iPad.
Comment 27 Alain 2014-02-21 14:26:40 UTC
Are you à solution for us ?
Comment 28 Sebastien Pouliot 2014-02-21 14:28:39 UTC
The immediate workaround is comment #12: break down the large methods into smaller chunks.
Comment 29 Alain 2014-02-21 14:33:05 UTC
Now, the big function have 260 lines. That's not normally...
Comment 30 Zoltan Varga 2014-02-21 14:46:15 UTC
Could you upload the new versions of the assemblies from Comment 15-18 ?
Comment 35 Alain 2014-02-21 14:52:19 UTC
Created attachment 6121 [details]
TranslationLib.dll with KmerhLib.dll
Comment 36 Zoltan Varga 2014-02-21 14:57:22 UTC
The problem seems to be with the KmehrLib.KMEHR_XML:WriteGPMigration method,
could you refactor it into smaller methods and see if that fixes the problem ?
Comment 37 Alain 2014-02-21 15:04:10 UTC
I try and I say you if that's run but not today.

Thanks

Alain
Comment 38 Alain 2014-03-04 13:45:06 UTC
We have working on  this function. Now, That's ok but the function make only 100 lines.

Is it normal ?
Comment 39 Zoltan Varga 2014-03-04 14:08:33 UTC
The problem occurs when a method has too many local variables, which that method had because it had a lot of foreach statements, and each of those created some local variables internally.