The “LinkAssemblies” task failed unexpectedly

前端 未结 12 1906
故里飘歌
故里飘歌 2020-12-30 18:50

When we are trying to build a xamarin forms project in release mode, we are getting the error:

C:\\Program Files (x86)\\MSBuild\\Xamarin\\Android\\Xamarin.An         


        
相关标签:
12条回答
  • 2020-12-30 19:30

    I ended up getting this error after changing the Android target version to 9.0. What I noticed is that in the packages.config of the Android project, all the packages were still targeting monoandroid81 instead of monoandroid90.

    I solved it by just reinstalling all NuGet packages. This can be done quite easily through the Package Manager Console in Visual Studio by entering:

    Update-Package -Reinstall
    

    I recommend taking a backup first, though.

    After that all the packages were targeting the correct version and the compilation errors were gone.

    0 讨论(0)
  • 2020-12-30 19:35

    I changed the Linker properties > Linking from Sdk Assemblies Only to Sdk and User Assemblies for the Release configuration.

    0 讨论(0)
  • 2020-12-30 19:36

    Apparently, this is a known issue: Xamarin Forms needs the TargetAndroidVersion to be 21. (In the config GUI, this is entitled "Compile using Android version:")

    0 讨论(0)
  • 2020-12-30 19:37

    Change linking to old mono android to new mono android. It worked for me. I changed from Monoandroid 8.0 to Monoandroid 9.0 of some dll's like Xamarin.Android.Platforms etc..

    0 讨论(0)
  • 2020-12-30 19:42

    In my chase I have changed the linker property ( Linker --> Linking ) to 'None'. I am using visual studio 2017 RC

    0 讨论(0)
  • 2020-12-30 19:42

    Jus I changed linking from "NONE" to "sdk and users assembly" and I ran my solution, and the issue has been solved. after that you can change "sdk and users assembly" to "NONE" and run your project without any issue.

    But the release file size may be will be change.

    enter image description here

    0 讨论(0)
提交回复
热议问题