Hi,
I'm using Xamarin Forms 3.6.0.264807, Telerik UI for Xamarin 2019.1.318.1, .Net standard 2.0.3 and Visual Studio 2017 (Win 10).
I would like to package and distribute the APK but in release mode the Android project fails to build.
This is the error (when linking SDK assemblies only):
Error The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void Telerik.XamarinForms.Common.PlatformCulture::.ctor(System.String)' in assembly: 'Telerik.XamarinForms.Common.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.String[] System.String::Split(System.Char,System.StringSplitOptions)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
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()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
A very similar error is produced when linking SDK and User assemblies.
I have tried changing the linking (only None option works).
Many times I have cleaned, deleted all obj and bin folders, re-cleaned and rebuilt the project and it always fails when linking assemblies.
I've removed all Telerik assemblies then the project will build successfully with either SDK or SDK and User assembly linking.
I've updated to latest Xamarin Forms (3.6.0.293080) and this behaves exactly the same.
I've looked through these forums and I have found similar problems, but most relate to upgrading XF from 2.X to 3.X. This is not the case for my app, it started as a XF 3+ application. I've only recently added Telerik assemblies and it all works fine in debug mode.
The most similar issue is this post: https://www.telerik.com/forums/build-fails---can't-resolve-the-reference-'system-string-system-string-split(system-char-system-stringsplitoptions)'. The differences are that my situation is Android project, and I am building/archiving using VS2017 (not hosted).
Do you have any suggestions?
Thanks,
Graeme