Bug 12243 - ScanAssemblies build task counts referenced assembly twice
Summary: ScanAssemblies build task counts referenced assembly twice
Status: RESOLVED FIXED
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-05-14 19:00 UTC by matticus
Modified: 2013-05-14 20:21 UTC (History)
2 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 GitHub or Developer Community 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 matticus 2013-05-14 19:00:38 UTC
I apologize if this is the wrong project/component for this bug.

I've been trying out the Xamarin Studio Starter Edition. I recently ran into the 32K limit, but was convinced that I should not have. Per Jonathan Pryor's suggestion, I setup diagnostic build output and definitely see what is going on, but I have no idea why. Here is the section of the output for the ScanAssemblies task.

---------------------------------
Task "ScanAssemblies"
    LinkAssemblies Task
      UseSharedRuntime: true
      MainAssembly: obj\Debug\assemblies\MyApp.Android.dll
      OutputDirectory: obj\Debug\android\assets\
      I18nAssemblies: 
      ReferenceAssembliesDirectory: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v2.3\;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\;;
      ResolvedAssemblies:
        obj\Debug\assemblies\MyApp.Android.dll
        obj\Debug\assemblies\Mono.Android.Support.v4.dll
        obj\Debug\assemblies\Mono.Android.dll
        obj\Debug\assemblies\mscorlib.dll
        obj\Debug\assemblies\System.Core.dll
        obj\Debug\assemblies\System.dll
        obj\Debug\assemblies\Mono.Security.dll
        obj\Debug\assemblies\System.Xml.dll
        obj\Debug\assemblies\MyApp.Android.Core.dll

      Code size for MyApp.Android.dll: 12800
      Code size for MyApp.Android.Core.dll: 14848
      Code size for MyApp.Android.Core.dll: 14848
      Application code size total: 42496

    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(163,5): mandroid error XA9005: User code size, 42496 bytes, is larger than 32768 and requires a Indie (or higher) License.

  Done executing task "ScanAssemblies" -- FAILED.
---------------------------------

It's counting my MyApp.Android.Core assembly twice. I tried removing the reference from the MyApp.Android application, commented some code that uses Core, and built with no problems. I added the reference to the Core library back in, and built with no problems. The moment I uncommented the code in the App that relies on Core, I got the error again.

On a hunch, I opened up the TaskyAndroid_Starter sample solution (from the Android Getting Starting page at: http://xamarin.com/getting-started/android). It builds without error. However, with the diagnostic build output, I can see it is counting the Core assembly twice as well. The only difference is, the total is under 32K. Here is that output for your reference.

---------------------------------
Task "ScanAssemblies"
    LinkAssemblies Task
      UseSharedRuntime: true
      MainAssembly: obj\Debug\assemblies\TaskyAndroid.dll
      OutputDirectory: obj\Debug\android\assets\
      I18nAssemblies: 
      ReferenceAssembliesDirectory: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v2.3\;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\;;
      ResolvedAssemblies:
        obj\Debug\assemblies\TaskyAndroid.dll
        obj\Debug\assemblies\mscorlib.dll
        obj\Debug\assemblies\Mono.Android.dll
        obj\Debug\assemblies\System.Core.dll
        obj\Debug\assemblies\System.dll
        obj\Debug\assemblies\Mono.Security.dll
        obj\Debug\assemblies\System.Xml.dll
        obj\Debug\assemblies\Tasky.Core.Anroid.dll

      Code size for TaskyAndroid.dll: 9216
      Code size for Tasky.Core.Anroid.dll: 6656
      Code size for Tasky.Core.Anroid.dll: 6656
      Application code size total: 22528

  Done executing task "ScanAssemblies".
---------------------------------

Thank you and regards.

-Matt
Comment 1 Jonathan Pryor 2013-05-14 20:21:37 UTC
Fixed in monodroid/master/f3cfe8f0 and monodroid/4.6.x/df8c2883.