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

Unable to launch app on iOS from both VS and VS MAC #16421

Closed
andrew-barlit opened this issue Jul 28, 2023 · 15 comments
Closed

Unable to launch app on iOS from both VS and VS MAC #16421

andrew-barlit opened this issue Jul 28, 2023 · 15 comments
Labels
area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging delighter-sc migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert partner/macios Issues for the Mac / iOS SDK partner/platform-tools Client Experiences Platform Tools 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

@andrew-barlit
Copy link

Description

I'm rewriting a legacy Xamarin app to MAUI platform (targeting Android and iOS). I've been working with Android emulator from the start of the migration process and everything went fine. But when I've tried to launch the app on iOS, I faced multiple issues which I can't resolve.

If I try to launch the app from VS MAC 17.6.1 (452) (running on Ventura 13.5), it builds the app but simulator returns the following error in "Application output" which sounds like a joke: This app needs to be updated by the developer to work on this version of iOS
Digging through the CoreSimulator logs reveals some more info:

com.apple.CoreSimulator.simctl[16590] : installApplication:withOptions:error:: Error Domain=IXUserPresentableErrorDomain Code=4 "Simulator device returned an error for the requested operation." UserInfo={NSLocalizedDescription=Simulator device returned an error for the requested operation., NSLocalizedFailureReason=This app needs to be updated by the developer to work on this version of iOS., NSLocalizedRecoverySuggestion=Failed to find matching arch for input file: /Users/sambridges/Library/Developer/CoreSimulator/Devices/94345F63-02C0-43A8-82E7-BB13961120D9/data/Library/Caches/com.apple.mobile.installd.staging/temp.vztTsJ/extracted/Payload/appname, SimCallingSelector=installApplication:withOptions:error:, NSUnderlyingError=0x600000965410 {Error Domain=IXUserPresentableErrorDomain Code=4 "appname Needs To Be Updated" UserInfo={NSUnderlyingError=0x600000965500 {Error Domain=MIInstallerErrorDomain Code=15 "Failed to find matching arch for input file: /Users/sambridges/Library/Developer/CoreSimulator/Devices/94345F63-02C0-43A8-82E7-BB13961120D9/data/Library/Caches/com.apple.mobile.installd.staging/temp.vztTsJ/extracted/Payload/appname" UserInfo={LegacyErrorString=IncorrectArchitecture, SourceFileLine=55, FunctionName=MIMachOFileMatchesMyArchitecture, NSLocalizedDescription=Failed to find matching arch for input file: /Users/sambridges/Library/Developer/CoreSimulator/Devices/94345F63-02C0-43A8-82E7-BB13961120D9/data/Library/Caches/com.apple.mobile.installd.staging/temp.vztTsJ/extracted/Payload/appname}}, NSLocalizedDescription=appname Needs To Be Updated, NSLocalizedRecoverySuggestion=Failed to find matching arch for input file: /Users/sambridges/Library/Developer/CoreSimulator/Devices/94345F63-02C0-43A8-82E7-BB13961120D9/data/Library/Caches/com.apple.mobile.installd.staging/temp.vztTsJ/extracted/Payload/appname, NSLocalizedFailureReason=This app needs to be updated by the developer to work on this version of iOS.}}}

If I try to launch the same app from VS 17.6.5 (running on Windows machine) via remote connection to the same Mac, app launches but crashes after ~5 seconds without any interaction with the app. No errors, remote connection to Mac just dies and that's it. In the Xamarin.Messaging-17.6.0.251 folder appears this text (timecode points to app crash event):

DateTime=2023-07-28T12:40:13.2839820Z: 07/28/2023 12:40:13Z
System.Net.Mqtt.Sdk.ClientPacketListener Warning: 0 : Client IDB1760251 - Packet Channel observable sequence has been completed: 07/28/2023 12:40:13Z System.Net.Mqtt.Sdk.MqttClientImpl Warning: 0 : Client - Packet observable sequence has been completed, hence closing the channel: Xamarin.Messaging.Client.AgentConsoleRunner{Xamarin.Messaging.IDB.IDBAgent} Warning: 0 : The connection to the Broker has been lost, the Agent should terminate: Xamarin.Messaging.IDB.IDBAgent Information: 0 : Xamarin.Messaging.IDB.IDBAgent Information: 0 : Killing existing MTouch processes before stopping the agent:

If I try to launch on a physical iPhone 6s, app won't even get installed and VS MAC then returns error "application not found"

We don't use much 3rd party packages in our project, here's the complete list:

"Azure.Storage.Blobs" Version="12.17.0"
"CommunityToolkit.Mvvm" Version="8.2.1"
"Microsoft.Extensions.Logging.Debug" Version="7.0.0"
"SkiaSharp.Views.Maui.Controls" Version="2.88.3"
"SkiaSharp.Views.Maui.Core" Version="2.88.3"
"System.Text.Json" Version="7.0.3"
"CommunityToolkit.Maui" Version="5.2.0"
"SQLitePCLRaw.bundle_green" Version="2.1.5"

Could someone please advise how I can proceed? I'm completely stuck at this point

Can't choose correct workload ID in this form, 'dotnet workload list' returns 7.0.92/7.0.100.

Steps to Reproduce

Unfortunately, can't provide at this point. App has pretty many views and services. I can launch blank app without any problems on the same environment, and app runs fine on Android emulator.

Link to public reproduction project repository

https://github.com/dotnet/maui

Version with bug

Unknown/Other

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 16.4, iOS 14.2

Did you find any workaround?

No workaround

Relevant log output

No response

@andrew-barlit andrew-barlit added the t/bug Something isn't working label Jul 28, 2023
@stefandb1995
Copy link

Any news on this? Started happening yesterday.

@andrew-barlit
Copy link
Author

Still stuck. Reinstalling VS doesn't help. Looks like I'd have to create an empty app, start copying modules here and try to find when it breaks. Super boring and time consuming process

@stefandb1995
Copy link

Still broken on latest preview.

@andrew-barlit
Copy link
Author

Yes, our project is still on hold, too.
Only way to debug the app on iOS is to launch it from Windows machine. It then works for some time, but debugger crashes randomly and after that if I try to relaunch the app, it crashes within 10 seconds. I've got to restart the Mac and reopen the VS. This takes a lot of time so it's practically unusable

@cucumber-sp
Copy link

Have you found any workaround? It just randomly stopped working for me too

@andrew-barlit
Copy link
Author

Current workaround is to launch the app from Windows machine connected to the Mac. "XAML hot reload" should be disabled or app crashes with 95% probability after 5-10 seconds after launch. Can launch on iPhone but without any debugging (debugger crashes)
From Mac it still not working at all, both on stable and preview VS. It keeps telling that app needs to be updated when I'm launching the app on simulator. If I try to launch it on iPhone, it can start without debugging but then crashes on splash screen.

@stefandb1995
Copy link

Not sure if anyone is still having problems with this, but it went away for a bit and then started happening again a few days ago. Think I finally tracked down the issue. For me it was the .user file for the main mobile project. The simulator project updated the PlatformTarget to not match the RuntimeIdentifier. Deleting this file solved my problem.

@andrew-barlit
Copy link
Author

Because VS for Mac is officially unsupported now, I just uninstalled it. I've tried to use VS code extension, but now I'm able to launch the app only on the actual phone. If I set target to any simulator, it fails with thousands of errors about incorrect assembly instruction. I'm aware now of this .user file which is messing things up, but even editing it won't help to get the app launched via VS code in simulator.
By the way, it's a great experience - having a file that is not a part of solution, not configurable from VS and which makes impossible to launch the app.
That's where I ended up - if simulator is needed, launch the app from VS in Windows, otherwise from VS code in Mac.
I still have no idea how is my app differs from the "blank" one which is works fine.

@stefandb1995
Copy link

That's so weird, my experience with VS code om mac has been really good. It works much better then VS for Mac. I've only had this one issue that I finally managed to resolve by just deleting the file and letting it recreate it. On windows it's a bit of a different story, there I got a lot of random errors, so I normally just swap to VS. If you do figure out what the problem is please post it, always good to know how to work around these errors especially with the retirement of VS for Mac.

@cucumber-sp
Copy link

@andrew-barlit this incorrect assembly instructions error usually comes from using native libraries which is missing simulator arch support

@stefandb1995
Copy link

@andrew-barlit have you tried adding

iossimulator-x64

to your simulator build config?

@andrew-barlit
Copy link
Author

@stefandb1995 With .net 8 preview it wasn't working, but today I've tried again by installing .net 8. Now app launches on simulator just fine from VS code. Looks like the issue was eventually fixed
@cucumber-sp Some of the errors I saw were referencing system.private.corelib. And the same project could've been launched from the windows machine. Maybe this was caused by native libraries, but this info would've been useless anyway

Now I'm finally trying to publish app to the app store from VS in windows, and guess what... Process hangs after ~10 minutes, just nothing happens. No CPU activity, no disk activity. I cannot see any logs in "output" window, maybe they're somewhere else. Will try from Mac, at least it started working better

Have to say that Android part of MAUI works very nice, cannot remember a single blocking bug. But for iOS is just like a bad quest room

@cucumber-sp
Copy link

cucumber-sp commented Nov 20, 2023

Have to say that Android part of MAUI works very nice, cannot remember a single blocking bug. But for iOS is just like a bad quest room

That's so true 😔 When I first time launched my app (I tested everything during development on Android) on iOS, all the layouts was broken, I first thought there's something with my emulator cuz it can't be THAT broken. I spent days just making layouts work the same. Making app work for iOS probably took more time for me then even developing it

@andrew-barlit
Copy link
Author

Update about publishing to the App Store - still won't able to do it from VS in windows. Just never finishes, cancel button isn't working, had to kill VS process in order to do something.
But running a publish command in CLI on Mac did the trick and after ~6 mins I've got an IPA file which then went to the Transporter and was successfully submitted.

@samhouts samhouts added partner/macios Issues for the Mac / iOS SDK migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue partner/platform-tools Client Experiences Platform Tools labels Apr 4, 2024
Copy link
Contributor

Thanks for the issue report @andrew-barlit! 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 Visual Studio for Windows feedback tool or Visual Studio for Mac 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.

@jfversluis jfversluis closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-tooling XAML & C# Hot Reload, XAML Editor, Live Visual Tree, Live Preview, Debugging delighter-sc migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert partner/macios Issues for the Mac / iOS SDK partner/platform-tools Client Experiences Platform Tools 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

6 participants