Bug 24377 - Xamarin.Forms linker error android API 16
Summary: Xamarin.Forms linker error android API 16
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-10 02:08 UTC by Mikael Nensén
Modified: 2015-06-01 16:50 UTC (History)
6 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 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 Mikael Nensén 2014-11-10 02:08:05 UTC
Description of Problem:
When I build our Xamarin.Forms Android client against API 16 (Compile, Minimum and Target set to API Level 16) I get a linker error; trying API 15 also yields a linker error, which I'm reporting separately.

Steps to reproduce the problem:
1. Create a Blank App (Xamarin.Forms Shared)
2. Update nuget packages to:
Xamarin Support Library v13 - 20.0.0.4
Xamarin Support Library v4 - 20.0.0.4
Xamarin.Forms - 1.2.3.6257
3. Select Release build configuration (Activates the linker, not activated during Debug build configuration)
4. Set Compile, Minimum and Target Android version to API Level 16
5. Build

Actual Results:
The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Void Android.Views.View::set_TextAlignment(Android.Views.TextAlignment)' (defined in 'Xamarin.Forms.Platform.Android, Version=1.2.3.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Platform.Android, Version=1.2.3.0, Culture=neutral, PublicKeyToken=null' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Views.View::set_TextAlignment(Android.Views.TextAlignment)
   at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
   at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
   at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
   at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
   at Mono.Linker.Steps.MarkStep.ProcessQueue()
   at Mono.Linker.Steps.MarkStep.Process()
   at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
   at Mono.Linker.Pipeline.Process(LinkContext context)
   at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
   at Xamarin.Android.Tasks.LinkAssemblies.Execute()
   --- End of inner exception stack trace ---

Expected Results:
Everything builds without any errors.

Additional Information:
Visual Studio 2013 Update 3

=== Xamarin Studio ===

Version 5.5.3 (build 6)
Installation UUID: 9d154c1f-68e2-4816-91e0-a89d18ce53d8
Runtime:
	Microsoft .NET 4.0.30319.34209
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

=== Xamarin.Android ===

Version: 4.18.1 (Trial Edition)
Android SDK: C:\Users\mnn\AppData\Local\Android\android-sdk
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.4   (API level 19)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_39
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) Client VM (build 20.14-b01, mixed mode, sharing)

=== Build Information ===

Release ID: 505030006
Git revision: fbe3e9453daf6a3bb9a9709ed22bec35f7c9056b
Build date: 2014-10-23 13:11:11-04
Xamarin addins: e44add2b39de4dd57c0742bb2e620dfad84c64c6

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 1 Udham Singh 2014-11-10 07:07:10 UTC
I have checked this issue and getting the same behaviour mentioned in bug description. To reproduce this issue I have followed the steps mentioned in bug description.

Screencast : http://www.screencast.com/t/reVoDZko6FtF

Error Log : https://gist.github.com/Udham1/d7272af6093dbf49bbdb
Application Output Log : https://gist.github.com/Udham1/abed2d22421a016259b0

Environment Info :

Windows 8

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.50938
Installed Version: Professional

Xamarin   3.7.248.0 (8ca7d11db8a6f874c6cd2de6d9ca0f511867ce91)
Xamarin.Android   4.18.1.3 (5474129af31e9d3a86cb7482c7c5c7a30ad315f1
Xamarin.iOS   8.4.0.0 (209abebbd8f1a292d042420edb45fa5fbd3f017b)
Comment 2 Udham Singh 2014-11-10 07:10:16 UTC
*** Bug 24378 has been marked as a duplicate of this bug. ***
Comment 3 Seth Rosetter 2015-06-01 16:46:48 UTC
This is fixed 1.4.2 (current stable)