Bug 11491 - Linker is stripping Android.App.Fragment
Summary: Linker is stripping Android.App.Fragment
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.6.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-03-31 12:03 UTC by Goncalo Oliveira
Modified: 2013-04-10 10:25 UTC (History)
3 users (show)

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


Attachments
test case (670.85 KB, application/x-zip-compressed)
2013-03-31 12:03 UTC, Goncalo Oliveira
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 NOT_REPRODUCIBLE

Description Goncalo Oliveira 2013-03-31 12:03:42 UTC
Created attachment 3723 [details]
test case

Mono for Android 4.6

Using Android.Support.V4.Fragment. Linker is stripping Android.App.Fragment and throwing an exception, even though it's not used. Project minimum android to target is 2.3. If I disable the linker it build fine. If I change minimum android to target to 4.0 it also builds fine.

1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018: The "LinkAssemblies" task failed unexpectedly.
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018: Mono.Cecil.ResolutionException: Failed to resolve Android.App.Fragment
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.Initialize()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018:    at Mono.Linker.Pipeline.Process(LinkContext context)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018:    at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018:    at Xamarin.Android.Tasks.LinkAssemblies.Execute()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(786,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
Comment 1 Atsushi Eno 2013-04-10 10:04:02 UTC
I tried to build your repro, but it looks like it's missing Newtonsoft.Json.dll so I could partially try. Anyways, what I see in the repro is that FrontcomMobileApp.Monodroid.TestCase project targets Gingerbread, and there is mismatch between GooglePlayServices project and this one. Could you correctly set ICS on the app project and build with your fully buildable solution?
Comment 2 Goncalo Oliveira 2013-04-10 10:25:21 UTC
That's it! The library was built for ICS and the app for Ginger, thus the conflict. If I set the library for Ginger, it all builds fine.

Thank you Atsushi.