-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Comments
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. |
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.
This issue will be automatically closed in 3 days if there are no further comments. |
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, |
@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? |
They'll have to switch to ship a .framework instead of a .a (static library), but it seems they already know that. |
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: 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, |
@rolfbjarne, could you please review the information from my previous comment? Thanks, |
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) |
Thank you! |
We are having the exact same issue with the Sentry .NET SDK for @AndreyMarten - I upvoted and added comments to the issue you created. Thank you! |
The problem exits with many frameworks/libraries (AppCenter, Firebase etc) |
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. |
I've figured out the issue. The I created a target that works around this problem. Put it in the https://gist.github.com/mattjohnsonpint/37d3ac06a563c41618fc933bf7282d66 @rolfbjarne - This (or something like it) probably belongs directly in |
@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). |
Indeed, we have symlinks in our xcframework zip, but not for the ios target. I believe this is common with Carthage builds. |
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. |
@mattjohnsonpint , where in the .csproj file should I put your XML addition? Tx |
It should work if added anywhere within the 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. |
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. |
@plattski - That's odd - It seems to be working for me. Let's continue this discussion at getsentry/sentry-dotnet#1961. Thanks. |
Thank you @mattjohnsonpint. You workaround seems to be working for me. I am using DevExpress Maui controls. |
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:
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:
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
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
The text was updated successfully, but these errors were encountered: