Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create native types when deployment is executed to iPhone from VS for Windows without pairing to MAC #10800

Closed
AndreyMarten opened this issue Oct 20, 2022 · 21 comments
Labels
platform/iOS 🍎 s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue t/bug Something isn't working

Comments

@AndreyMarten
Copy link

Description

Our customers encounter serious issues when directly deploy a MAUI app to iPhone from Visual Studio for Windows (without pair to Mac).

Any application with DevExpress Maui packages fails when it is deployed this way. The following error is shown:

[0:] An error occurred: 'Could not create an native instance of the type 'DevExpress.Navigation.iOS.DXTabControlUIView': the native class hasn't been loaded.
It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.'. Callstack: '   at Foundation.NSObject.InitializeObject(Boolean alloced)
   at Foundation.NSObject..ctor(NSObjectFlag x)
   at UIKit.UIResponder..ctor(NSObjectFlag t)
   at UIKit.UIView..ctor(NSObjectFlag t)
   at DevExpress.Navigation.iOS.DXTabControlUIView..ctor()
   at DevExpress.Maui.Controls.TabViewHandler.CreatePlatformView()
   at Microsoft.Maui.Handlers.ViewHandler`2[[DevExpress.Maui.Controls.TabView, DevExpress.Maui.Controls, Version=22.1.4.0, Culture=neutral, PublicKeyToken=null],[DevExpress.Navigation.iOS.DXTabControlUIView, DevExpress.Maui.iOS.Navigation, Version=22.2.1.0, Culture=neutral, PublicKeyToken=null]].OnCreatePlatformView()
   at Microsoft.Maui.Handlers.ViewHandler.OnCreatePlatformElement()
   at Microsoft.Maui.Handlers.ElementHandler.CreatePlatformElement()
   at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
   at Microsoft.Maui.Handlers.ViewHandler`2[[DevExpress.Maui.Controls.TabView, DevExpress.Maui.Controls, Version=22.1.4.0, Culture=neutral, PublicKeyToken=null],[DevExpress.Navigation.iOS.DXTabControlUIView, DevExpress.Maui.iOS.Navigation, Version=22.2.1.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view)
   at Microsoft.Maui.Handlers.ViewHandler`2[[DevExpress.Maui.Controls.TabView, DevExpress.Maui.Controls, Version=22.1.4.0, Culture=neutral, PublicKeyToken=null],[DevExpress.Navigation.iOS.DXTabControlUIView, DevExpress.Maui.iOS.Navigation, Version=22.2.1.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
   at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
   at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
   at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
   at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
   at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
   at Microsoft.Maui.Handlers.ContentViewHandler.UpdateContent(IContentViewHandler handler)
   at Microsoft.Maui.Handlers.ContentViewHandler.MapContent(IContentViewHandler handler, IContentView page)
   at Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass5_0[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Handlers.IContentViewHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v)
   at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
   at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
   at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
   at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view)
   at Microsoft.Maui.Handlers.ContentViewHandler.SetVirtualView(IView view)
   at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
   at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
   at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
   at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
   at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
   at Microsoft.Maui.Platform.ViewExtensions.ToHandler(IView view, IMauiContext context)
   at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.SetPageRenderer(Page page, ShellContent shellContent)
   at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.LoadRenderers()
   at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.ViewDidLoad()
   at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName)
   at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass)
   at NugetsMauiApp.Program.Main(String[] args) in C:\downloads\FLD_0.zip046\NugetsMauiApp\NugetsMauiApp\NugetsMauiApp\Platforms\iOS\Program.cs:line 13
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)'

When we pair Visual Studio to Mac, the issue does not occur. We also see that everything works correctly when we deploy from a Mac machine.


We researched this issue and found out that our Native libraries were not copied to the Frameworks folder in obj and bin:

image

image


I attached a simple sample with all the required local nuget packages. I also attached a short screencast illustrating the steps to replicate this behavior. The repository is available from this link: https://github.com/AndreyMarten/direct-deployment-to-iphone-error.

sample.zip
https://user-images.githubusercontent.com/31204429/196892501-3022bc2a-f13c-4151-a7f8-f34016a57a5b.mp4

Steps to Reproduce

  1. Unpack the attached project (sample.zip) or download the project from the corresponding repository. Open the application in VS for Windows;
  2. Define settings in your Visual Studio:
    1. Unpair your Visual Studio from MAC (if it is already paired);
    2. Add a local iPhone device;
    3. Select the local device as a target one.
  3. Build the application;
  4. Try to deploy and run the application on the target local device;

Visual Studio's output window will show the error that I illustrated above. See these steps in the screencast I attached earlier (https://user-images.githubusercontent.com/31204429/196892501-3022bc2a-f13c-4151-a7f8-f34016a57a5b.mp4)

Link to public reproduction project repository

https://github.com/AndreyMarten/direct-deployment-to-iphone-error

Version with bug

7.0 Release Candidate 2

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15

Did you find any workaround?

No response

Relevant log output

Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/Microsoft.iOS.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Runtime.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Collections.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Runtime.InteropServices.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Threading.Thread.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Threading.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.Http.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Numerics.Vectors.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.Sockets.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Drawing.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Private.Uri.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/Xamarin.PreBuilt.iOS.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/Xamarin.iOS.HotRestart.Application.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/netstandard.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.IO.MemoryMappedFiles.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.IO.Pipes.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Memory.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Diagnostics.Tracing.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Collections.NonGeneric.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/Microsoft.Win32.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.NameResolution.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Threading.ThreadPool.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Runtime.CompilerServices.Unsafe.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Collections.Concurrent.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Runtime.InteropServices.RuntimeInformation.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Diagnostics.Process.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.ComponentModel.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.ComponentModel.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.ObjectModel.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Diagnostics.FileVersionInfo.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Reflection.Metadata.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Collections.Immutable.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Linq.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.IO.Compression.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Text.Encoding.Extensions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Collections.Specialized.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Security.Cryptography.X509Certificates.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Security.Cryptography.Algorithms.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Security.Cryptography.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Formats.Asn1.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Runtime.Numerics.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Security.Cryptography.Encoding.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.ComponentModel.TypeConverter.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Runtime.Loader.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.Security.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Security.Claims.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Text.RegularExpressions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Reflection.Emit.ILGeneration.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Reflection.Emit.Lightweight.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Reflection.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Runtime.Serialization.Formatters.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Resources.Writer.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Xml.XDocument.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Private.Xml.Linq.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Private.Xml.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Diagnostics.TraceSource.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Diagnostics.DiagnosticSource.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.Quic.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.IO.Compression.Brotli.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Threading.Channels.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.NetworkInformation.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Reflection.Emit.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Linq.Expressions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.ComponentModel.EventBasedAsync.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Console.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Data.Common.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Xml.ReaderWriter.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Xml.XmlSerializer.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Transactions.Local.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Diagnostics.Contracts.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Diagnostics.TextWriterTraceListener.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Diagnostics.StackTrace.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.IO.Compression.ZipFile.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.IO.FileSystem.DriveInfo.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.IO.FileSystem.Watcher.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.IO.IsolatedStorage.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Linq.Queryable.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Linq.Parallel.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.Requests.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.WebHeaderCollection.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.ServicePoint.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.HttpListener.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.WebSockets.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Security.Principal.Windows.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.WebClient.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.WebProxy.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.Mail.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.Ping.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Net.WebSockets.Client.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Reflection.DispatchProxy.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Runtime.CompilerServices.VisualC.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Runtime.Serialization.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Runtime.Serialization.Xml.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Private.DataContractSerialization.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Runtime.Serialization.Json.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Security.Cryptography.Csp.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Threading.Overlapped.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Threading.Tasks.Parallel.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Web.HttpUtility.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Xml.XPath.XDocument.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Xml.XPath.dll [External]
Thread started:  #2
Thread started: .NET Timers #3
2022-10-20 12:15:48.938 Xamarin.PreBuilt.iOS[2645:170562] Content folder: /var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content

2022-10-20 12:15:48.939 Xamarin.PreBuilt.iOS[2645:170562] App path /var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/NugetsMauiApp.dll

Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/NugetsMauiApp.dll
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Maui.Controls.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Maui.dll [External]
2022-10-20 12:15:49.033 Xamarin.PreBuilt.iOS[2645:170562] AppDelegate name: AppDelegate

Thread started: <Thread Pool> #4
Thread started: .NET ThreadPool Gate #5
Thread started: <Thread Pool> #6
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.Scheduler.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Maui.Graphics.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.Core.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.iOS.Scheduler.dll [External]
Thread started: <Thread Pool> #7
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Maui.Controls.Compatibility.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.iOS.Editors.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.iOS.CollectionView.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.Controls.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.iOS.Navigation.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Extensions.DependencyInjection.Abstractions.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Extensions.Logging.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Extensions.Logging.Abstractions.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Extensions.Options.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Maui.Controls.Xaml.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.iOS.Grid.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.DataGrid.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.Editors.dll [External]
Thread started: <Thread Pool> #8
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Extensions.Configuration.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Extensions.Configuration.Abstractions.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Extensions.Primitives.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Extensions.Logging.Debug.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Maui.Essentials.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.CollectionView.dll [External]
Loaded assembly: /private/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.Extensions.DependencyInjection.dll [External]
Resolved pending breakpoint for 'NugetsMauiApp.Program.Main(System.String[])' to C:\downloads\FLD_0.zip048\direct-deployment-to-iphone-error-main\NugetsMauiApp\Platforms\iOS\Program.cs:10 [0x00000].
Loaded assembly: data-0x1357ac000 [External]
Loaded assembly: data-0x1357c0000 [External]
2022-10-20 12:15:50.116 Xamarin.PreBuilt.iOS[2645:170562] Could not resolve assembly Microsoft.VisualStudio.DesignTools.TapContract, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.

2022-10-20 12:15:50.121 Xamarin.PreBuilt.iOS[2645:170562] Could not resolve assembly Xamarin.HotReload.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Xamarin.HotReload.Contracts.dll' or one of its dependencies.

Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointSendToIde(System.String)' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:423 [0x00000].
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Text.Json.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/17436CE4-6EE0-4914-9E23-4DFEB7F969E9/NugetsMauiApp.app/System.Text.Encodings.Web.dll [External]
2022-10-20 12:15:50.297 Xamarin.PreBuilt.iOS[2645:170562] Could not resolve assembly Xamarin.HotReload.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Xamarin.HotReload.Contracts.dll' or one of its dependencies.

2022-10-20 12:15:50.299 Xamarin.PreBuilt.iOS[2645:170562] Could not resolve assembly Microsoft.VisualStudio.DesignTools.TapContract, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/Microsoft.VisualStudio.DesignTools.TapContract.dll' or one of its dependencies.

Resolved pending breakpoint for 'Xamarin.HotReload.HotReloadAgent.BreakpointCheckpoint()' to D:\a\_work\1\s\HotReload\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:418 [0x00000].
Thread started:  #9
Thread started:  #10
Thread started:  #11
2022-10-20 12:15:50.959 Xamarin.PreBuilt.iOS[2645:170562] Could not resolve assembly System.Private.DataContractSerialization.resources, Version=6.0.0.0, Culture=en-UA, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/System.Private.DataContractSerialization.resources.dll' or one of its dependencies.

2022-10-20 12:15:50.961 Xamarin.PreBuilt.iOS[2645:170562] Could not resolve assembly System.Private.DataContractSerialization.resources, Version=6.0.0.0, Culture=en, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/System.Private.DataContractSerialization.resources.dll' or one of its dependencies.

[0:] Microsoft.Maui.Controls.BindableObject: Warning: Cannot convert 7 to type 'System.Single'
2022-10-20 12:15:52.043 Xamarin.PreBuilt.iOS[2645:170562] Could not resolve assembly DevExpress.Maui.Scheduler.resources, Version=22.1.4.0, Culture=en-UA, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.Scheduler.resources.dll' or one of its dependencies.

2022-10-20 12:15:52.045 Xamarin.PreBuilt.iOS[2645:170562] Could not resolve assembly DevExpress.Maui.Scheduler.resources, Version=22.1.4.0, Culture=en, PublicKeyToken=null. Details: Could not load file or assembly '/var/mobile/Containers/Data/Application/467AC82B-56DD-44D2-A5AB-215DFAA972B5/Documents/NugetsMauiApp.content/DevExpress.Maui.Scheduler.resources.dll' or one of its dependencies.

[0:] An error occurred: 'Could not create an native instance of the type 'DevExpress.Navigation.iOS.DXTabControlUIView': the native class hasn't been loaded.
It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.'. Callstack: '   at Foundation.NSObject.InitializeObject(Boolean alloced)
   at Foundation.NSObject..ctor(NSObjectFlag x)
   at UIKit.UIResponder..ctor(NSObjectFlag t)
   at UIKit.UIView..ctor(NSObjectFlag t)
   at DevExpress.Navigation.iOS.DXTabControlUIView..ctor()
   at DevExpress.Maui.Controls.TabViewHandler.CreatePlatformView()
   at Microsoft.Maui.Handlers.ViewHandler`2[[DevExpress.Maui.Controls.TabView, DevExpress.Maui.Controls, Version=22.1.4.0, Culture=neutral, PublicKeyToken=null],[DevExpress.Navigation.iOS.DXTabControlUIView, DevExpress.Maui.iOS.Navigation, Version=22.2.1.0, Culture=neutral, PublicKeyToken=null]].OnCreatePlatformView()
   at Microsoft.Maui.Handlers.ViewHandler.OnCreatePlatformElement()
   at Microsoft.Maui.Handlers.ElementHandler.CreatePlatformElement()
   at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
   at Microsoft.Maui.Handlers.ViewHandler`2[[DevExpress.Maui.Controls.TabView, DevExpress.Maui.Controls, Version=22.1.4.0, Culture=neutral, PublicKeyToken=null],[DevExpress.Navigation.iOS.DXTabControlUIView, DevExpress.Maui.iOS.Navigation, Version=22.2.1.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view)
   at Microsoft.Maui.Handlers.ViewHandler`2[[DevExpress.Maui.Controls.TabView, DevExpress.Maui.Controls, Version=22.1.4.0, Culture=neutral, PublicKeyToken=null],[DevExpress.Navigation.iOS.DXTabControlUIView, DevExpress.Maui.iOS.Navigation, Version=22.2.1.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
   at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
   at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
   at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
   at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
   at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
   at Microsoft.Maui.Handlers.ContentViewHandler.UpdateContent(IContentViewHandler handler)
   at Microsoft.Maui.Handlers.ContentViewHandler.MapContent(IContentViewHandler handler, IContentView page)
   at Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass5_0[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Handlers.IContentViewHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v)
   at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
   at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
   at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
   at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view)
   at Microsoft.Maui.Handlers.ContentViewHandler.SetVirtualView(IView view)
   at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
   at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
   at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
   at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
   at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
   at Microsoft.Maui.Platform.ViewExtensions.ToHandler(IView view, IMauiContext context)
   at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.SetPageRenderer(Page page, ShellContent shellContent)
   at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.LoadRenderers()
   at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.ViewDidLoad()
   at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName)
   at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass)
   at NugetsMauiApp.Program.Main(String[] args) in C:\downloads\FLD_0.zip048\direct-deployment-to-iphone-error-main\NugetsMauiApp\Platforms\iOS\Program.cs:line 13
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)'
The app has been terminated.
@AndreyMarten AndreyMarten added the t/bug Something isn't working label Oct 20, 2022
@drasticactions
Copy link
Contributor

drasticactions commented Oct 20, 2022

I would guess that the DevExpress library is using a static library or framework for their iOS Control, and that's not supported with Xamarin Hot Restart, (https://learn.microsoft.com/en-us/xamarin/xamarin-forms/deploy-test/hot-restart).

I would probably ask DevExpress about how it is created for this specific control.

This is also not a specific issue for MAUI (The UI Framework), but either the DevExpress control, or Xamarin Hot Restart.

@drasticactions drasticactions added the s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue label Oct 20, 2022
@ghost
Copy link

ghost commented Oct 20, 2022

Thanks for the issue report @AndreyMarten! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.

If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.

  1. Go to the VS feedback tool to report the issue
  2. Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.

This issue will be automatically closed in 3 days if there are no further comments.

@AndreyMarten
Copy link
Author

You are right - we do use static libraries. Therefore, the behavior looks expected as it is related to the corresponding limitation.

Thank you for pointing this out and for sharing the link.

I believe that we can consider the issue closed.

Thanks,
Andrey

@drasticactions
Copy link
Contributor

@AndreyMarten Ah, I didn't know you worked on it. It should be possible to get it working if it can be dynamically loaded. @rolfbjarne @dalexsoto Is there any information that could help them out?

@rolfbjarne
Copy link
Member

They'll have to switch to ship a .framework instead of a .a (static library), but it seems they already know that.

@AndreyMarten
Copy link
Author

Hi guys,

Thank you for these updates.

Unfortunately, I was mistaken in my previous comment. I discussed the way we build our assemblies with our team and my colleagues confirmed that we do not use static libraries. Please accept my apologies.

Here is a screenshot illustrating how we build assemblies and create NuGet packages:

ApplicationFrameHost_jjcU50CShw

Do you see any issues in the settings above? Should the Hot Restart feature work with assemblies that are built in this way?


Please clarify whether it's OK to continue discussion here or if I should post a corresponding report via Visual Studio.

Thanks,
Andrey

@AndreyMarten AndreyMarten reopened this Oct 21, 2022
@AndreyMarten
Copy link
Author

@rolfbjarne, could you please review the information from my previous comment?

Thanks,
Andrey

@rolfbjarne
Copy link
Member

From looking at the code, it looks like hot restart doesn't support xcframeworks.

This means the comment here is still correct: #10800 (comment) (please file this as VS feedback)

@AndreyMarten
Copy link
Author

@mattjohnsonpint
Copy link
Contributor

We are having the exact same issue with the Sentry .NET SDK for net6.0-ios targets (with or without MAUI).
See getsentry/sentry-dotnet#1961

@AndreyMarten - I upvoted and added comments to the issue you created. Thank you!

@AlleSchonWeg
Copy link
Contributor

The problem exits with many frameworks/libraries (AppCenter, Firebase etc)
@AndreyMarten perhaps its better to open a feature request to support static libraries via Hot Restart. You will get my vote ;)

@mattjohnsonpint
Copy link
Contributor

I just tried rebuilding everything as a regular framework. Not an XCFramework. It still fails, in the same way.

Only dynamic libraries involved, nothing static.

@mattjohnsonpint
Copy link
Contributor

I've figured out the issue. The _UnpackHotRestartFrameworkAssemblies target is assuming that framework files will be found as embedded resources in assemblies. When brought in via NuGet packages, they're not. They're either in a folder or zip file within the NuGet package itself.

I created a target that works around this problem. Put it in the .csproj of the app that's being built with Hot Restart and everything should work. I tested with nugets having either regular framework or xcframework.

https://gist.github.com/mattjohnsonpint/37d3ac06a563c41618fc933bf7282d66

@rolfbjarne - This (or something like it) probably belongs directly in Xamarin.iOS.HotRestart.targets. Should I open an issue and/or PR on the xamarin-macios repository?

@rolfbjarne
Copy link
Member

@mattjohnsonpint I've created an issue in xamarin-macios: dotnet/macios#16571.

A PR would be very welcome!

Regarding your fix: have in mind that the bound framework is usually zipped if it contains symlinks, and since symlinks won't work correctly on Windows, a complete fix should probably detect zips with symlinks and show an error in that case (symlinks are most common in macOS and Mac Catalyst frameworks, so it shouldn't be a common problem for mobile platforms, although there's nothing stopping a framework vendor from doing it).

@mattjohnsonpint
Copy link
Contributor

Indeed, we have symlinks in our xcframework zip, but not for the ios target. I believe this is common with Carthage builds.

@ghost
Copy link

ghost commented Nov 6, 2022

This issue is being closed due to inactivity. If this issue is still affecting you, please follow the steps above to use the VS Feedback Tool to report the issue.

@ghost ghost closed this as completed Nov 6, 2022
@plattski
Copy link

plattski commented Nov 7, 2022

@mattjohnsonpint , where in the .csproj file should I put your XML addition? Tx

@mattjohnsonpint
Copy link
Contributor

It should work if added anywhere within the <Project></Project>. I usually put custom targets towards the end.

I've also submitted a similar fix to Microsoft in dotnet/macios#16605 - so hopefully the workaround is temporary, depending on when that gets released.

@plattski
Copy link

plattski commented Nov 8, 2022

Sorry, but this didn't solve the problem. Still crashes with:

[0:] An error occurred: 'Could not create an native instance of the type 'Sentry.CocoaSdk.SentryOptions': the native class hasn't been loaded.
It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.'. Callstack: ' at Foundation.NSObject.InitializeObject(Boolean alloced)
at Foundation.NSObject..ctor(NSObjectFlag x)
at Sentry.CocoaSdk.SentryOptions..ctor() in //src/Sentry.Bindings.Cocoa/obj/Release/net6.0-ios/iOS/Sentry.CocoaSdk/SentryOptions.g.cs:line 60
at Sentry.SentrySdk.InitSentryCocoaSdk(SentryOptions options) in /
/src/Sentry/Platforms/iOS/SentrySdk.cs:line 22
at Sentry.SentrySdk.InitHub(SentryOptions options) in //src/Sentry/SentrySdk.cs:line 60
at Sentry.SentrySdk.Init(SentryOptions options) in /
/src/Sentry/SentrySdk.cs:line 109
at Sentry.Maui.Internal.SentryMauiInitializer.Initialize(IServiceProvider services) in /_/src/Sentry.Maui/Internal/SentryMauiInitializer.cs:line 16
at Microsoft.Maui.Hosting.MauiAppBuilder.Build()
at SentryTest.MauiProgram.CreateMauiApp() in D:\SentryTest\SentryTest\MauiProgram.cs:line 34
at SentryTest.AppDelegate.CreateMauiApp() in D:\SentryTest\SentryTest\Platforms\iOS\AppDelegate.cs:line 8
at Microsoft.Maui.MauiUIApplicationDelegate.WillFinishLaunching(UIApplication application, NSDictionary launchOptions)
at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName)
at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass)
at SentryTest.Program.Main(String[] args) in D:\SentryTest\SentryTest\Platforms\iOS\Program.cs:line 13
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)'
The app has been terminated.

@mattjohnsonpint
Copy link
Contributor

@plattski - That's odd - It seems to be working for me. Let's continue this discussion at getsentry/sentry-dotnet#1961. Thanks.

@udayr
Copy link

udayr commented Dec 2, 2022

It should work if added anywhere within the <Project></Project>. I usually put custom targets towards the end.

I've also submitted a similar fix to Microsoft in xamarin/xamarin-macios#16605 - so hopefully the workaround is temporary, depending on when that gets released.

Thank you @mattjohnsonpint. You workaround seems to be working for me. I am using DevExpress Maui controls.

@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform/iOS 🍎 s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants