Laerdal / Xamarin.AzureCommunicationCalling

Xamarin iOS and Android binding libraries for Microsofts Azure Communication Services
MIT License
36 stars 11 forks source link

Linker issues when using Link SDK assemblies only #15

Closed Immons closed 3 years ago

Immons commented 3 years ago

Hello,

Experiencing issue with linker in Android project when using bindings lib, have you maybe seen it and knows the resolution?

  Xamarin.Android.Legacy.targets(487, 5): [XALNK7000] Mono.Linker.MarkException: Error processing method: 'System.Void Com.Azure.Android.Core.Util.DateTimeRfc1123::.ctor(ThreeTen.BP.OffsetDateTime)' in assembly: 'Xamarin.AzureCore.Android.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve ThreeTen.BP.OffsetDateTime
  at Mono.Linker.Steps.MarkStep.HandleUnresolvedType (Mono.Cecil.TypeReference reference) [0x00013] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at Mono.Linker.Steps.MarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x0002c] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at MonoDroid.Tuner.MonoDroidMarkStep.MarkType (Mono.Cecil.TypeReference reference) [0x00000] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x000c8] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x0001b] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
   --- End of inner exception stack trace ---
  at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00047] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue () [0x0000a] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at Mono.Linker.Steps.MarkStep.Process () [0x000f6] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x0000d] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at MonoDroid.Tuner.MonoDroidMarkStep.Process (Mono.Linker.LinkContext context) [0x0000b] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at Mono.Linker.Pipeline.ProcessStep (Mono.Linker.LinkContext context, Mono.Linker.Steps.IStep step) [0x0000d] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x0000f] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at MonoDroid.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at MonoDroid.Tuner.Linker.Process (MonoDroid.Tuner.LinkerOptions options, Mono.Linker.ILogger logger, Mono.Linker.LinkContext& context) [0x00071] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at Xamarin.Android.Tasks.LinkAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x00177] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at Xamarin.Android.Tasks.LinkAssemblies.RunTask () [0x0001b] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 
  at Xamarin.Android.Tasks.AndroidTask.Execute () [0x00000] in <331267c8bd6c4f46a93dbb66d4ef5c11>:0 

Best regards

tompi commented 3 years ago

Hey @lmmons Probably my fault for not getting the dependencies right, I see my "actual" apps using ACS have a dependency on "Xamarin.Android.JakeWharton.ThreeTenAbp", could you try adding that on the android project and see if it works?

Not Sure why the "testapp" works without it, Ill try have a look next time I upgrade the libs, keeping this issue open till then.

Immons commented 3 years ago

Hey @tompi I even added it some time after posting this and noticed it works, so that's the proper solution :)

CARP-Kaiser commented 3 years ago

Hello @tompi the testapp works without the nuget in debug mode but fails in release mode. It probably has to deal with the linker settings. Thank you for the example.