maui icon indicating copy to clipboard operation
maui copied to clipboard

iOS Debug cannot start but build and deploy works

Open sencagri opened this issue 1 year ago • 1 comments

Description

Hello,

When I try to debug my iOS app. I get the warning about start the app from phone now then it tries to start debugging but eventually it fails to start. The log files are below:


========== Deploy completed at 14:49 and took 03,276 seconds ==========
Launching 'AktifBarkod.AktifPOS.Mobil' on 'Çağrı iPhonu'u'...
Please launch the application 'AktifPOS' on the device 'Çağrı iPhonu'u' to continue. For the first launch, if the application does not show up, please reboot your device.
Connecting iOS Debugger to 'Çağrı iPhonu'u' over USB on port 10000...
Connected iOS Debugger to 'Çağrı iPhonu'u' over USB on port 10000
Connecting iOS Debugger to 'Çağrı iPhonu'u' over USB on port 10000...
Connected iOS Debugger to 'Çağrı iPhonu'u' over USB on port 10000
Connecting iOS Debugger to 'Çağrı iPhonu'u' over USB on port 10000...
Connected iOS Debugger to 'Çağrı iPhonu'u' over USB on port 10000
Reading from debug console stream...
Reading from device stream...
Connected IDB.Local to Debugger port 54329
Reading from machine (TCP) stream...
Closing debug communication from device stream
Closing debug communication from machine (TCP)
Cannot read from machine (TCP) stream anymore...
Error writting to debug stream. Details: Cannot access a disposed object.
Object name: 'AppleDeviceUsbStream'.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.5

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 17 iPhone 14 Pro

Did you find any workaround?

No response

Relevant log output

No response

sencagri avatar Jan 12 '24 12:01 sencagri

Thanks for the issue report @sencagri! 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.

ghost avatar Jan 12 '24 21:01 ghost

same issue...

smhasan avatar Feb 14 '24 16:02 smhasan

Microsoft Visual Studio Enterprise 2022 Version 17.9.0

smhasan avatar Feb 14 '24 16:02 smhasan

same issue...

Hi Hasan can you try remove all debug points?

sencagri avatar Feb 14 '24 18:02 sencagri

Hi @sencagri thanks for prompt reply I cleared all breakpoints but still the same issue

The app has been terminated. INFO: Disposing console and debugger streams... ERROR: An error occurred while writing to the debug stream. Details: Cannot access a disposed object. Object name: 'UsbStream'. INFO: Disposing input and output streams... INFO: Closing debug connection from remote debugger (TCP) ERROR: An error occurred when writing to the output stream. Details: Unable to read data from the transport connection: Operation aborted. INFO: Disposing input and output streams... INFO: 2024-02-14 18:59:48.647 VSTORE[732:62603] at VSTORE.BadgeShellTabbarAppearanceTracker.UpdateLayout(UITabBarController controller) in D:\WORKSPACEFINAL\VSTORE\VSTORE\Platforms\iOS\TabbarBadgeRenderer.cs:line 27 2024-02-14 18:59:48.647 VSTORE[732:62603] at Microsoft.Maui.Controls.Platform.Compatibility.ShellItemRenderer.ViewDidLayoutSubviews() at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 58 2024-02-14 18:59:48.647 VSTORE[732:62603] at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 94 at VSTORE.Program.Main(String[] args) in D:\WORKSPACEFINAL\VSTORE\VSTORE\Platforms\iOS\Program.cs:line 15

INFO: Closing debug connection from device (USB) INFO: 2024-02-14 18:59:48.646 VSTORE[732:62603] Index was outside the bounds of the array.

smhasan avatar Feb 14 '24 18:02 smhasan

But Please note a simple app is working fine, I am able to deploy on my Physical device iPhone 11

smhasan avatar Feb 14 '24 18:02 smhasan

Your debug output look different than mine. I think some kind of exception prevents debugging.

sencagri avatar Feb 14 '24 20:02 sencagri

My MacBook has xcode 15.2, I think this is the reason I can't deploy asper MSVS warning below

Severity Code Description Project File Line Suppression State Details Warning The Xcode version installed on the Mac (15.2) is not compatible with this version of Visual Studio. This may cause unexpected warnings or errors when building and deploying iOS projects. Please install Xcode '14.3'. To download a specific version of Xcode, visit: https://developer.apple.com/downloads. If multiple versions of Xcode are installed on the Mac, you may specify which version to use under Tools -> Options -> Xamarin -> iOS Settings 0

smhasan avatar Feb 15 '24 08:02 smhasan

As indicated please report to the Visual Studio feedback system, that is the right place for this!

jfversluis avatar Mar 30 '24 18:03 jfversluis

I'm experiencing the same issue on both Visual Studio for Windows (connected via network to a physical iPad mini 6th gen), Mac, and Mac CLI build tools. Building and deploying locally on Windows seems to resolve the issue, but the debugger times out or fails further down the line during startup. Prior to the upgrade, I could only make it to Platform/iOS/Program => Main. Now it executes some of my code before crashing without any obvious error message.

Upgrading Visual Studio on Windows (version 17.9.6) and Mac (version 17.6.11: 400) does not appear to resolve the issue.

showtroylove avatar Apr 15 '24 14:04 showtroylove

Exact same issue here.

Using VS Version 17.10.0 Preview 2.0

Richard-Dufour avatar Apr 23 '24 21:04 Richard-Dufour

In your Project Properties -> iOS -> Build -> LLVM and activate Debug there. This fixed it for me.

SleepyDevelops avatar Apr 26 '24 09:04 SleepyDevelops

In your Project Properties -> iOS -> Build -> LLVM and activate Debug there. This fixed it for me.

I did the above, as well as in Project Properties

  • iOS/Build/Linker/Debug: Link Framework SDKs only (was "Don't Link")
  • iOS/Debugging/net8.0-ios/True (was "default") from Debug on menu bar, Debugging/XAML Hot Reload, uncheck "Enable XAML Hot Reload"

AND, at least it starts. BUT, after hitting a breakpoint, it craps out with a similar message --> I don't which if any made a difference

bobwhitten avatar May 02 '24 18:05 bobwhitten

Check you project file if you're using version control for minute changes. Changes that have unwittingly caused serious changes to the applications build and debugging.

On Thu, May 2, 2024 at 2:19 PM Bob Whitten @.***> wrote:

In your Project Properties -> iOS -> Build -> LLVM and activate Debug there. This fixed it for me.

I did the above, as well as in Project Properties

  • iOS/Build/Linker/Debug: Link Framework SDKs only (was "Don't Link")
  • iOS/Debugging/net8.0-ios/True (was "default") from Debug on menu bar, Debugging/XAML Hot Reload, uncheck "Enable XAML Hot Reload"

AND, at least it starts. BUT, after hitting a breakpoint, it craps out with a similar message --> I don't which if any made a difference

— Reply to this email directly, view it on GitHub https://github.com/dotnet/maui/issues/19858#issuecomment-2091213569, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADO6DLIUDLT2OCW5VGHYKVDZAJ7RZAVCNFSM6AAAAABBYBHCBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJRGIYTGNJWHE . You are receiving this because you commented.Message ID: @.***>

showtroylove avatar May 03 '24 01:05 showtroylove

still running into this issue, it is infuriating. can't get any debugging done

MitchBomcanhao avatar May 21 '24 10:05 MitchBomcanhao

Same issue here. Using VS Version 17.10.2

andersondamasio avatar Jun 13 '24 18:06 andersondamasio

same issue

aherrick avatar Jun 29 '24 18:06 aherrick