Bug 48014 - blank xaml app (xamarin.forms portable) release build fails
Summary: blank xaml app (xamarin.forms portable) release build fails
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General ()
Version: 4.2.0 (C8)
Hardware: PC Windows
: --- blocker
Target Milestone: 4.3.0 (C9)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-26 07:59 UTC by office
Modified: 2016-12-05 14:19 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 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:
VERIFIED FIXED

Description office 2016-11-26 07:59:45 UTC
# Steps to reproduce
1. create a new project of type 'blank xaml app (xamarin.forms portable) ' in a new solution
2. set the .Droid project as startup project
3. select 'Release' as solution configuration
4. build the solution
# Expected behavior
the build should succeed

# Actual behavior
the build failed with error:
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018: The "LinkAssemblies" task failed unexpectedly.
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018: Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Void Android.Support.V4.Widget.DrawerLayout::AddDrawerListener(Android.Support.V4.Widget.DrawerLayout/IDrawerListener)' (defined in 'Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Support.V4.Widget.DrawerLayout::AddDrawerListener(Android.Support.V4.Widget.DrawerLayout/IDrawerListener)
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.ProcessQueue()
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.Process()
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Mono.Linker.Pipeline.Process(LinkContext context)
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Xamarin.Android.Tasks.LinkAssemblies.Execute()
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    --- End of inner exception stack trace ---
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Java.Interop.Tools.Diagnostics.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Xamarin.Android.Tasks.LinkAssemblies.Execute()
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1586,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()


# Supplemental info (logs, images, videos)


# Test environment (full version information)
About Microsoft VisualStudio infos copied:

Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework Version 4.6.01055
Installed Version: Professional
LightSwitch for Visual Studio 2015   00322-50052-05835-AA568
Microsoft LightSwitch for Visual Studio 2015
Microsoft Visual Studio Tools for Applications 2015   00322-50052-05835-AA568
Microsoft Visual Studio Tools for Applications 2015
Visual Basic 2015   00322-50052-05835-AA568
Microsoft Visual Basic 2015
Visual C# 2015   00322-50052-05835-AA568
Microsoft Visual C# 2015
Visual C++ 2015   00322-50052-05835-AA568
Microsoft Visual C++ 2015
Application Insights Tools for Visual Studio Package   7.12.01117.1
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)
ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563
ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/
Command Bus, Event Stream and Async Manager   Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.
Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
JavaScript Language Service   2.0
JavaScript Language Service
JavaScript Project System   2.0
JavaScript Project System
JetBrains ReSharper Ultimate 2016.2.2    Build 106.0.20160913.91321
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.
Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools
NuGet Package Manager   3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools
TypeScript   1.8.36.0
TypeScript tools for Visual Studio
Windows Installer XML Toolset   3.10.3.3007
Windows Installer XML Toolset version 3.10.3.3007
Copyright (c) .NET Foundation and contributors. All rights reserved.
Xamarin   4.2.1.64 (872717c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin.Android   7.0.2.37 (ce955cc)
Visual Studio extension to enable development for Xamarin.Android.
Xamarin.iOS   10.2.1.5 (44931ae)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 2 Jose Gallardo 2016-12-02 19:54:01 UTC
Hi,

We're going to replace the old cross-platform templates with a new set of templates where this issue is fixed.
That new version will be out in the next XVS 4.3 preview (which will be available in the Alpha channel probably next week).

If using that new version you are still facing this issue, please don't hesitate on reopening the issue.

Thanks
Comment 3 Sunil Kumar 2016-12-05 14:19:21 UTC
I have checked this issue using new cross-platform Blank App(XAML) -> PCL template and C9 Xamarin.VisualStudio_4.3.0.459_7c3dcf2933b16c679e3922ec63c34e64f383eec9 and observed that now this issue is working fine. Now Blank App(XAML) -> PCL template builds successfully in Release Mode as shown in screencast: http://www.screencast.com/t/ojm7TosN

I have also checked this issue with latest master Xamarin.VisualStudio_99.1.0.320_67278ac69c452189dc327489d07e4581988d6e79 and observed that this issue is also working fine with master build as shown in screencast: http://www.screencast.com/t/FJ04Ngshpb9K

Hence I am closing this issue marking its status as VERIFIED.

Environment info:
C9: https://gist.github.com/sunil360/90768ce31e573c130ba62465557e6a68
Master: https://gist.github.com/sunil360/8a15d96d24058ccd33e9fa252306fc59