Hello, it's been a while since I did not have this kind of problem : building the app in release mode with a linking mode differentt to none throws an error which I'm unable to get rid off (neither SDK only nor SDK and User assemblies options work).
Here is the error I got while compiling (notice that I can't deploy and thus open device log to see advanced/more verbal logs.
System.InvalidCastException: Unable to cast object of type 'System.Byte' to type 'System.String'.
at Mono.Cecil.MetadataBuilder.GetConstantSignature(ElementType type, Object value)
at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
at Mono.Cecil.MetadataBuilder.AddField(FieldDefinition field)
at Mono.Cecil.MetadataBuilder.AddFields(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.ModuleWriter.<>c.b__5_0(MetadataBuilder builder, MetadataReader _)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func
3 read) at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata) at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
at Mono.Cecil.AssemblyDefinition.Write(String fileName, WriterParameters parameters)
at Mono.Linker.Steps.OutputStep.WriteAssembly(AssemblyDefinition assembly, String directory, WriterParameters writerParameters)
at Mono.Linker.Steps.OutputStep.OutputAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.OutputStep.ProcessAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.BaseStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
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)
I don't see any clue on the project or the dll that is messing my project.
I've tried the linking.config approach where you specify a linker.description which is supposed to say to the compiler "don't touch those dll". But didn't manage to make it work.
At first, I thought it might be some dependencies not working but I found an old backup (6months ago) and it builds well in release mode with linking mode set to SDK only. I've tried to upgrade every packages from the project to match the packages' version I use in my project (the latest version). The old project seems to still compile fine in release mode with linking assemblies set to SDK...
I'm a bit lost. It's hard to find which dependencies got a problem since I need to do a ton of merge and additional work if I want to use the latest updates. I've tried to find some additional info on the web but couldn't find any tips.
I need help because my project goes from (linking SDK only) 66mo to 119mo. The gap is huge and I would like to release some updates without increasing the size by 80%... Users will think I've added massive new features whereas I did not
Any help or feedback on how you made it working will be much appreciate.
Thanks for reading so far.
If you a need any further information to help me, let me know ! Thanks again and have a good day.