I'm using Xamarin Forms 188.8.131.524807, 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)
--- End of inner exception stack trace ---
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)
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 (184.108.40.2063080) 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?