Skip to content

ExecutionEngineException: Attempting to JIT compile method '(wrapper unknown) LibVLCSharp.Shared.DialogCallbacks:StructureToPtr To stop App in IOS

please help me to fix This bug.

I have a camera ip use http type "http://192.168.0.153/xxx", This camera have certificate http I The camera run in Sarafi in IOS then run ok when I buld in xamarin user libvlcCshap then have a bug, the app in iphone to stop when open camera This is my code:

Core.Initialize();
var tcs = new TaskCompletionSource<bool>();
LibVLC = new LibVLC();
 try
{
      LibVLC.SetDialogHandlers((title, text) => Task.CompletedTask,
      (dialog, title, text, username, store, token) =>
       {
               // show UI dialog
                    // On "OK" call PostLogin
                    dialog.PostLogin("MyCamera", "12345678", false);
                    tcs.TrySetResult(true);
                    return Task.CompletedTask;
        },
(dialog, title, text, type, cancelText, actionText, secondActionText, token) => Task.CompletedTask,
(dialog, title, text, indeterminate, position, cancelText, token) => Task.CompletedTask,(dialog, position, text) => Task.CompletedTask);

MediaPlayer = new MediaPlayer(LibVLC)
  {
    Media = new Media(LibVLC,
     @"http://192.168.0.253/nphMotionJpeg?Resolution=640x480&Quality=Standard",
      FromType.FromLocation)
};
 MediaPlayer.Play();

  await tcs.Task;

The App begin to stop when 
MediaPlayer.Play();
await tcs.Task;

Relevant logs and/

System.ExecutionEngineException: Attempting to JIT compile method '(wrapper unknown) LibVLCSharp.Shared.DialogCallbacks:StructureToPtr (object,intptr,bool)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal.StructureToPtr(object,intptr,bool) at System.Runtime.InteropServices.Marshal.StructureToPtr[T] (T structure, System.IntPtr ptr, System.Boolean fDeleteOld) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.4.0.64/src/Xamarin.iOS/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs:1229 at LibVLCSharp.Shared.LibVLC.SetDialogHandlers (LibVLCSharp.Shared.DisplayError error, LibVLCSharp.Shared.DisplayLogin login, LibVLCSharp.Shared.DisplayQuestion question, LibVLCSharp.Shared.DisplayProgress displayProgress, LibVLCSharp.Shared.UpdateProgress updateProgress) [0x0 00f1] in <1b469c787fe4469d94bf00a7bbdf9fb2>:0 at anFa.View.Dialogue.Device.MainViewModel+d__21.MoveNext () [0x00053] in C:.................................\MainViewModel.cs:49

Environment

  • OS: IOS 12.1
  • Version 12.1
  • Device: Iphone 6S
  • LibVLC version and architecture
  • LibVLCSharp version 3.02

Possible fixes

Please help me about This bug

Edited by Jérémy VIGNELLES
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information