Bug 24378 - Xamarin.Forms linker error android API 14 and 15
Summary: Xamarin.Forms linker error android API 14 and 15
Status: RESOLVED ANSWERED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: PC Windows
: Normal critical
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-10 02:11 UTC by Mikael Nensén
Modified: 2015-01-21 12:35 UTC (History)
10 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 ANSWERED

Description Mikael Nensén 2014-11-10 02:11:23 UTC
Description of Problem:
When I build our Xamarin.Forms Android client against API 15 (Compile, Minimum and Target set to API Level 15) I get a linker error.

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 15
5. Build

Actual Results:
The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'Android.Text.InputTypes Android.Widget.SearchView::get_InputType()' (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 Android.Text.InputTypes Android.Widget.SearchView::get_InputType()
   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 Mikael Nensén 2014-11-10 03:37:33 UTC
Same problem targeting API 14.
Comment 2 Udham Singh 2014-11-10 07:10:16 UTC

*** This bug has been marked as a duplicate of bug 24377 ***
Comment 3 Mikael Nensén 2014-11-10 08:05:03 UTC
It's not a duplicate, this one is about:
'Android.Text.InputTypes Android.Widget.SearchView::get_InputType()'

while bug 24377 is about:
'System.Void
Android.Views.View::set_TextAlignment(Android.Views.TextAlignment)'
Comment 4 Arpit Jha 2014-11-11 00:50:22 UTC
We have checked this issue and able to reproduce this issue with the help of bug description.

We observed that getting build error 'Android.Text.InputTypes' only on Release configuration.Its working fine in debug configuration.

Note: This is an intermittent issue I am getting build error 2 times out of 10 times.

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

Environment Info:
Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

Xamarin   3.7.248.0 (8ca7d11db8a6f874c6cd2de6d9ca0f511867ce91)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.18.1.3 (5474129af31e9d3a86cb7482c7c5c7a30ad315f1)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.4.0.0 (209abebbd8f1a292d042420edb45fa5fbd3f017b)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 7 Nicholas Blumhardt 2015-01-06 00:38:53 UTC
This is non-intermittent for us, failing every Xamarin.Forms Release build we attempt targeting API 14. I notice XF 1.3 was just released without a fix for this - is there any ETA? It seems like a blocking bug, it'd be great to know if there is any workaround. Many thanks!
Comment 8 Nicholas Blumhardt 2015-01-06 18:45:03 UTC
For anyone else working around this: changing the <TargetFrameworkVersion> in the Android app's csproj file to 5.0 fixed this, and continued to run on API 14 (compile with SDK 21).
Comment 9 Mikael Nensén 2015-01-15 01:57:52 UTC
You've fixed it, meaning what exactly? It's a configuration problem/mismatch regarding versions or it's fixed as in it'll be in the Xamarin.Forms version x.y.z.b nuget package?