Bug 22113 - The "LinkAssemblies" task failed unexpectedly. API 14 Minimum, but needed API 16 to package correctly
Summary: The "LinkAssemblies" task failed unexpectedly. API 14 Minimum, but needed API...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.2
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-08-14 12:06 UTC by Jon Douglas [MSFT]
Modified: 2015-02-05 14:27 UTC (History)
5 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 Jon Douglas [MSFT] 2014-08-14 12:06:50 UTC
I'm seeing a bit of customers having issues creating an APK because of the following error:

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly. Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'System.Void Android.Animation.AnimatorListenerAdapter::OnAnimationPause(Android.Animation.Animator)' (defined in 'Xamarin.Forms.Platform.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Platform.Android, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' could not be resolved. at Xamarin.Android.Diagnostic.Error(Int32 code, String message, Object[] args) at Xamarin.Android.Tasks.LinkAssemblies.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() (MSB4018) (test.Android)

The solution is to change the API level to 16. We show that Xamarin.Forms for Android requires a minimum of API 14, which is somewhat confusing customers when they try to deploy their app and this happens.
Comment 1 Jon Douglas [MSFT] 2014-08-14 12:15:04 UTC
I meant to say that API level 19 is needed for OnAnimationPause in the above comment.

For this issue:

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.2.0, Culture=neutral,
PublicKeyToken=null') from 'Xamarin.Forms.Platform.Android,
Version=1.2.2.0, Culture=neutral, PublicKeyToken=null' could not be
resolved.

at Xamarin.Android.Diagnostic.Error(Int32 code, String message, Object[]
args)

at Xamarin.Android.Tasks.LinkAssemblies.Execute()

at
Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()

at
Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()

API level 16 is needed.
Comment 2 Jatin 2014-08-26 10:52:11 UTC
Hi,

This issue is w.r.t Android Forms PCL project.

The issue is that after creating the project the default value for Target framework is Android 4.0.3 API 15. 

And using this configuration when user Link Assemblies, and build the application, build error "XA2006" appears as stated above.

However, if we change the target framework to Android 4.4 API 19, and then after adding assemblies when build the application, it builds successfully.

Hence, the proposed solution is to make changes in the Android Forms PCL project such that the default value selected should be Android 4.4 API 19 so that the build error does not appear.

Environment information:

=== Xamarin Studio ===

Version 5.3 (build 435)
Installation UUID: 522f0c5e-80a3-4414-aec7-1f3b9c1768d1
Runtime:
	Microsoft .NET 4.0.30319.18408
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.25

=== Xamarin.Android ===

Version: 4.16.0 (Business Edition)
Android SDK: C:\Users\Admin\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)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		4.5    (API level 21)
Java SDK: C:\Program Files\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: 503000435
Git revision: 1e0c5fa7482a0356a71dfa469a3f71f5478a4660
Build date: 2014-08-25 12:47:56-04
Xamarin addins: 69708b283b171ea053d0edfbf09d98457d21fbee

=== Operating System ===

Windows 6.1.7601.65536
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2014-09-24 16:28:07 UTC
Bug for the incorrect TargetFrameworkVersion in the Xamarin Studio
Xamarin.Forms templates filed here:
https://bugzilla.xamarin.com/show_bug.cgi?id=22182
Comment 4 Jason Smith [MSFT] 2015-02-05 14:27:59 UTC
This should be resolved