Bug 45834 - Link fails with out of the box cross-platform template
Summary: Link fails with out of the box cross-platform template
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: Linker (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Radek Doulik
URL:
Depends on:
Blocks:
 
Reported: 2016-10-24 14:00 UTC by Daniel Cazzulino
Modified: 2017-10-04 15:39 UTC (History)
2 users (show)

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


Attachments
Repro solution (300.13 KB, application/x-7z-compressed)
2016-10-24 14:00 UTC, Daniel Cazzulino
Details
Diagnostics build log (108.60 KB, application/x-7z-compressed)
2016-10-24 14:00 UTC, Daniel Cazzulino
Details
Same log, newer XA @ master (108.95 KB, application/x-7z-compressed)
2016-10-24 14:23 UTC, Daniel Cazzulino
Details

Description Daniel Cazzulino 2016-10-24 14:00:13 UTC
Created attachment 18189 [details]
Repro solution

Attached repro solution and diagnostics log.

Repro: 
- File | New | Cross-Platform App (Master Detail)
- Android options:
    * Compile using Latest (Android 7.0)
    * Minimum Android to target: 4.0.3
    * Target Android version: Use Compile using SDK version

(all default values for my Android SDK installation).

Failure:

1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018: The "LinkAssemblies" task failed unexpectedly.
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018: System.ArgumentNullException: Value cannot be null.
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018: Parameter name: variable
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Cecil.Cil.VariableIndex..ctor(VariableDefinition variable)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Cecil.Cil.CodeReader.ReadScope(ScopeDebugInformation scope)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Cecil.Cil.CodeReader.ReadScopes(Collection`1 scopes)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Cecil.Cil.CodeReader.ReadScope(ScopeDebugInformation scope)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Cecil.Cil.CodeReader.ReadDebugInfo()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Cecil.Cil.CodeReader.ReadMethodBody()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition method)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Cecil.MetadataReader.ReadMethodBody(MethodDefinition method)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Cecil.MethodDefinition.<get_Body>m__1(MethodDefinition method, MetadataReader reader)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TRet& variable, TItem item, Func`3 read)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Cecil.MethodDefinition.get_Body()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.ProcessQueue()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.Process()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Mono.Linker.Pipeline.Process(LinkContext context)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,5): error MSB4018:    at Xamarin.Android.Tasks.LinkAssemblies.Execute()
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1575,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(1575,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
Comment 1 Daniel Cazzulino 2016-10-24 14:00:54 UTC
Created attachment 18190 [details]
Diagnostics build log
Comment 2 Daniel Cazzulino 2016-10-24 14:22:27 UTC
Version info:

Xamarin   4.3.0.108 (5dd47ef)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.99.132 (c75aaaa)
Visual Studio extension to enable development for Xamarin.Android.
Comment 3 Daniel Cazzulino 2016-10-24 14:23:11 UTC
Created attachment 18191 [details]
Same log, newer XA @ master
Comment 4 Radek Doulik 2016-10-26 13:34:58 UTC
I am unable to repro so far, with master.

Might be windows only issue, will try it on Windows as well - so far tested on Mac with cmd line dbuild.
Comment 5 Radek Doulik 2016-10-26 14:11:11 UTC
One thing I noticed on Mac.

When building in XS I had to change the frameworks part of project.json to use "MonoAndroid,Version=v7.0" and restore nuget packages (again). After changing that it built in XS/Mac as well.
Comment 6 Daniel Cazzulino 2016-10-27 05:27:15 UTC
That's interesting. Will see if I can play some more with it
Comment 7 Jon Douglas [MSFT] 2017-10-04 15:39:02 UTC
I attempted to reproduce this with current stable builds on VS 2017 and it seems to build successfully. Thus I believe this issue is fixed. I am marking this issue as RESOLVED INVALID due to the nature of this being resolved in a current build.

Note You need to log in before you can comment on or make changes to this bug.