Error Executing task LinkAssemblies for Android Release Build

AzizBatihkAzizBatihk USMember, University

I recently built an application using Xamarin.Forms. The Android app runs fine when using the Debug profile for compilation, however when switching over to Release then compiling it, I get:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:

Error: Error executing task LinkAssemblies: error XA2006: Reference to metadata
item 'Android.Text.InputTypes Android.Widget.SearchView::get_InputType()'
(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.
(USFSPConnect.Android)

I'm running the latest version of Xamarin, Xamarin.Android & have the latest version of Xamarin.Forms from Nuget. This happens on Mac OS X 10.10 and Windows 7/8. Has anyone had a similar issue?

«1

Posts

  • TheRealJasonSmithTheRealJasonSmith USXamarin Team Xamurai

    This is a bug in the latest version of Xamarin.Forms when compiled for API level 15 or less. It will be fixed in the next release. For now you can make sure you are targeting the latest android release (make sure you have the sdk's installed). API 14 support will be restored very soon.

  • AzizBatihkAzizBatihk USMember, University

    Thanks! That did the trick!

  • BenCochraneBenCochrane USMember

    Is there anything else that can be done to fix this? I've made sure to update to the newest NuGet package, switched to API level 19, cleaned and rebuilt, and still getting this error.

  • JonayRguezJonayRguez ESMember ✭✭

    Hi. I have the same problem. Change "Android Minimum version" to 16 or more, Clean and rebuilt doesn't solve the situation.

    Any possible solution?.

    Regards

  • AdamCroserAdamCroser AUMember ✭✭
    edited June 2014

    I have the same problem with my app, even though I have set my min target to 19. So, I tried compiling the example apps, and hit the same problem with the FormsGallery example, but only after updating the packages. The MobileCRM example doesn't suffer from this problem.

    So I suspect the problem is related to the classes we use from the Forms library.

  • JonayRguezJonayRguez ESMember ✭✭

    @AdamCroser: Hi. I'm not sure that is a problem with an specific class in the Forms library:

    • I have created a new Xamarin.Form Shared project.
    • I have changed the Minimum Android Version and Target Android Version to API 19.
    • I have build the Android application in release mode and the Xamarin Studio (Version 5.0.1, build 3) write the following error:
      /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Error executing task LinkAssemblies: 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

    As you can see, the problem is generic. I expect Xamarin can solve this critical error as soon as possible.

  • JoeDluzenJoeDluzen USBeta ✭✭

    Same here, no matter which API level I try, it is the same. On Forms 1.1.1.6206.

  • JoeDluzenJoeDluzen USBeta ✭✭

    Ok, got past my issue. Maybe it's the same as yours: make sure your Build -> Android Application -> [Minimum|Target] Android version are right, including Build -> General -> Target framework.

  • JonayRguezJonayRguez ESMember ✭✭

    A lot of thanks. It works!!

  • KeithRoweKeithRowe USMember

    Thank you @AdamCroser‌! Huge help!

  • JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    This is an awesome post by Redth on what all these numbers mean: http://redth.codes/such-android-api-levels-much-confuse-wow/

  • BryanRheaBryanRhea USMember, University ✭✭

    I just went through this as well.
    Using 4.3 as target and API 15 for minimum did not work.
    I installed 4.4 and set it as build target with 15 as minimum and now it works.

  • NagashreeSNagashreeS USMember

    Thanks a Lot. This helped me too. I upgraded to android 4.4 version and it works.

  • JohanClaesonJohanClaeson SEMember, University

    Any news about this issue? We really need to support older v4.0+ devices :(

  • DevinRoseDevinRose USMember ✭✭

    I'm hitting this issue too and need to be able to target older versions. Is the "next release" 1.2.3? Or something later?

  • Same here... We also need to support older devices. I've just mailed to [email protected] for some feedback...

  • GiusepeGiusepe BRMember ✭✭

    Thanks a lot @JoeDluzen‌ and @AdamCroser‌

    "To be more specific, I set: Build > General > Target framework: Use latest installed platform (4.4) Build > Android Application > Minimum Android version: Override - Android 4.0.3 (API Level 15) Build > Android Application > Target Android version: Automatic - use target framework version."

    Worked perfectly.

  • MaxPoolMaxPool USMember ✭✭

    @JasonASmith‌ - Did you have a bugzilla task for this? Still getting the error after upgrading to all the newest bits 1.2.3 / 3.7 ...

  • ElskurkosElskurkos USMember

    Still waiting for a solution. Really need 4.0 support.

  • JOAOSerraJOAOSerra PTMember ✭✭

    still waiting

  • JohanClaesonJohanClaeson SEMember, University

    Same here, when can we expect an update?

  • ShameelShameel INMember ✭✭

    Thanks a Lot. This helped me too.

  • hitting this problem also. It seems few months have passed with this issue. What's happening ?

  • VincentPoirierVincentPoirier CAMember ✭✭
    edited December 2014

    We have the same problem. We use Xamarin.Forms 1.3 pre-4, target the latest framework and the minimum is API 15.
    We can't get the .apk file because it only builds in debug. :neutral_face:
    We're on Xamarin Studio 5.7 (build 657) and Xamarin.Android 4.20.0.

    Anyone has any idea what could be causing this?

    Hi @JasonASmith‌, is there anything I can try to make it work or get you guys more information?

  • The same!
    Is there any chance it will be fixed?

  • KenKenKenKen HKMember

    Xamarin.Forms 1.3 same problem.....OMG

  • CodeLinguistCodeLinguist USMember ✭✭

    Same issue here for Xamarin.Forms 1.3.

  • mikehamil10mikehamil10 USMember ✭✭
    edited January 2015

    Ahh, balls! This week I've updated to Xamarin.Forms 1.3 and so far I've been doing only debug builds.

    I now want to do a Release build (and export an .apk) and I'm getting this error...no bueno.

    P.S. I'm on 1.3.1-pre and have Android 4.4 set to the API level for EVERYTHING (general settings, Minimum AND Target)...

  • VincentPoirierVincentPoirier CAMember ✭✭

    You can post your console log here. If it's something similar to what I had, you'll have to add [Preserve] somewhere or remove packages. I can't guarantee anything.

  • mikehamil10mikehamil10 USMember ✭✭
    edited January 2015

    You know what, I JUST figured it out (and it was being caused by a package). I'm using Xamarin.Forms.Labs in my project and the version I was using (1.2.0) for some reason won't build in Release mode alongside Xamarin.Forms 1.3.1. Building in debug worked fine, but switching to Release killed it...

    So I updated Xamarin.Forms.Labs to 1.2.1-pre and it compiled in Release mode just fine!

  • VincentPoirierVincentPoirier CAMember ✭✭

    That's great! I saw your post on bugzilla too.

  • mikehamil10mikehamil10 USMember ✭✭

    Yeah I'll edit my post there too. I'm just not sure if the Xamarin team checks here or there most often ;)

    Thanks for the prompt response though. I just tried doing a release build this afternoon and saw it break and freaked out!

  • MarkWallisMarkWallis AUMember

    Still getting the problem :-( more than a year after it "will be fixed in the next build".

    I had to go all the way up to API Level 19 to get it to compile!

    Is there some other work around? I don't want to reduce the number devices that can use my app by that much!

    If no other work around is there a fix coming soon?

    I don't know what it it even trying to do, is it important? Can we just hack the msbuild files and remove the step??

    Is it because we're missing some bits? i.e. do we need to go into the Android SDK manager and download and install EVERYTHING? That's cool if we have to...happy to do it, but will it fix it??

    Thanks!

  • Same here!!! I cannot use the linker... my app is 46 Mo in size and I have to compile for API 21 for the linker to work.

  • Sten.5163Sten.5163 USMember

    Is there any way to prevent this from ever coming up again? It looks like every XF version one needs to up the target API.

    I'm getting the same error:

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Error executing task LinkAssemblies: error XA2006: Reference to metadata item 'System.Void Android.Widget.AbsListView::SetSelectionFromTop(System.Int32,System.Int32)' (defined in 'Xamarin.Forms.Platform.Android, Version=1.3.3.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Platform.Android, Version=1.3.3.0, Culture=neutral, PublicKeyToken=null' could not be resolved.

  • tkowalczyktkowalczyk PLMember, University ✭✭

    I am getting this error too (but now for the first time) I have set up:
    Minimum Android Version - API 17
    Target Android Version - Automatic use target framework version
    Buil - General - Android 4.4

    in Debug everything is ok but in Release I got the following error.

    error:
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Error executing task LinkAssemblies: error XA2006: Reference to metadata item 'System.Void Android.Widget.AbsListView::SetSelectionFromTop(System.Int32,System.Int32)' (defined in 'Xamarin.Forms.Platform.Android, Version=1.3.4.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Platform.Android, Version=1.3.4.0, Culture=neutral, PublicKeyToken=null' could not be resolved. (Persevy.Android)

  • PatrickWilliamsPatrickWilliams USMember
    edited February 2015

    I am getting the same problem. Error goes away when I tell the project not to use the linker.

    I've tried increasing the minimum API, but it hasnt seemed to matter. Anything I can do to help resolve the problem, let me know.

    I am using SQLite.Net, RestSharp, and Xam.Plugins.Settings if that makes any difference.

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Error executing task LinkAssemblies: error XA2006: Reference to metadata item 'System.Void Android.Widget.AbsListView::SetSelectionFromTop(System.Int32,System.Int32)' (defined in 'Xamarin.Forms.Platform.Android, Version=1.3.4.0, Culture=neutral, PublicKeyToken=null') from 'Xamarin.Forms.Platform.Android, Version=1.3.4.0, Culture=neutral, PublicKeyToken=null' could not be resolved. (Project.Droid)

    EDIT: I forgot to mention that the app doesnt work (it opens the first screen and crashes) when building in release without the linker... I assuming that these issues are somehow related.

  • The edited in issue in my above post is not related to the linker issue.

  • Still no solution?

Sign In or Register to comment.