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

iOS App is getting killed by Watchdog on physical device when debugging #10748

Closed
jeromelaban opened this issue Dec 16, 2022 · 16 comments
Closed
Labels
blocked/vs Categorizes an issue as blocked by a Visual Studio problem kind/tracking-only Categorizes an issue that is currently open for tracking purposes only.

Comments

@jeromelaban
Copy link
Member

I'm having a very annoying issue right now regarding iOS. I can't debug on a physical device because the application is being killed by iOS Watchdog. I don't understand why since it's working fine on the simulator.

Here is the debug output.

Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Collections.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Runtime.Numerics.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Security.Cryptography.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Formats.Asn1.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Collections.Concurrent.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Security.Cryptography.Encoding.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Security.Cryptography.Algorithms.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Collections.NonGeneric.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Security.Cryptography.X509Certificates.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Private.Uri.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Microsoft.Win32.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Security.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Quic.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.NameResolution.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.IO.Compression.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.IO.Compression.Brotli.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Threading.Channels.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Runtime.InteropServices.RuntimeInformation.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Sockets.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.NetworkInformation.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Diagnostics.DiagnosticSource.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Http.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Drawing.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.ServicePoint.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Net.Requests.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Microsoft.iOS.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Linq.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Collections.Immutable.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.ObjectModel.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.ComponentModel.Primitives.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.ComponentModel.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Collections.Specialized.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Diagnostics.TraceSource.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Text.RegularExpressions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Linq.Expressions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Private.Xml.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Private.Xml.Linq.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.ComponentModel.TypeConverter.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.Foundation.Logging.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.Foundation.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.Diagnostics.Eventing.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.UI.Dispatching.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Linq.Queryable.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.Xaml.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Runtime.CompilerServices.Unsafe.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.UI.Composition.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/System.Console.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Uno.UI.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Microsoft.Extensions.Logging.Abstractions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Chinook.StackNavigation.Abstractions.dll [External]
Loaded assembly: /private/var/containers/Bundle/Application/0498628C-A09A-4DA8-B542-E16C7E411FBC/ApplicationTemplate.Mobile.app/Chinook.SectionsNavigation.Abstractions.dll [External]
The app has been terminated.

Here is my configuration for debug.

<When Condition="'$(TargetFramework)'=='net6.0-ios'">
	<PropertyGroup>
		<MtouchExtraArgs>$(MtouchExtraArgs) --setenv=MONO_GC_PARAMS=soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep,concurrent-sweep</MtouchExtraArgs>
		<MtouchExtraArgs>$(MtouchExtraArgs) --xml=./iOS/LinkerExclusions.xml --linkskip=$(AssemblyName)</MtouchExtraArgs>
		<!-- See https://github.com/unoplatform/uno/issues/9430 for more details. -->
		<MtouchExtraArgs>$(MtouchExtraArgs) --registrar:static</MtouchExtraArgs>
		<!-- See https://github.com/xamarin/xamarin-macios/issues/14812 for more details. -->
		<MtouchExtraArgs>$(MtouchExtraArgs) --marshal-objectivec-exceptions:disable</MtouchExtraArgs>
		<MtouchLink>Full</MtouchLink>
	</PropertyGroup>
	<Choose>
		<When Condition="'$(Configuration)'=='Debug'">
			<PropertyGroup>
				<CodesignEntitlements>./iOS/Entitlements.plist</CodesignEntitlements>
				<MtouchDebug>True</MtouchDebug>
				<MtouchExtraArgs>$(MtouchExtraArgs) --optimize=-remove-dynamic-registrar --setenv=MONO_LOG_LEVEL=debug --setenv=MONO_LOG_MASK=gc</MtouchExtraArgs>
				<Optimize>False</Optimize>
			</PropertyGroup>
			<PropertyGroup Condition="'$(Platform)'=='iPhone'">
				<CodesignKey>iPhone Developer</CodesignKey>
			</PropertyGroup>
		</When>
</When>

This is why I think it`s the iOS Watchdog.
image
image

Originally posted by @Soap-141 in #10746

@jeromelaban jeromelaban added platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform area/external Categorizes an issue or PR as being external to the Uno project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools labels Dec 16, 2022
@jeromelaban
Copy link
Member Author

@Soap-141 can you try doing this: dotnet/maui#11392 (comment), and see what the stack trace looks like?

@Soap-141
Copy link

@jeromelaban Yes, should be done next Monday. So to be sure you need the same crash report but with debug symbols?

@spouliot
Copy link
Contributor

This behaviour can be duplicated without Uno, just dotnet new ios and VSfM.

I have not tried from Windows but I doubt that would change anything since it ends up being the SDK's mlaunch to install/launch the process to be debugged.

@Soap-141
Copy link

Soap-141 commented Jan 26, 2023

Got some updates dotnet/maui#9056 looks like MS bot wants to close the issue and that right now people are agreeing that it's device slowness issue even if it shouldn't be the case I'm using an iPhone 11 and it's not that old.

@jeromelaban
Copy link
Member Author

It's not something we'll be able to fix on our end, in all cases, so we'll only be able to push on Microsoft to get this issue resolved.

@MartinZikmund
Copy link
Member

@Soap-141 is this still relevant? It seems the linked issue on Microsoft side has been fixed

@MartinZikmund MartinZikmund added triage/needs-information Indicates an issue needs more information in order to work on it. and removed platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform area/external Categorizes an issue or PR as being external to the Uno project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools labels Aug 23, 2023
@Soap-141
Copy link

Soap-141 commented Aug 23, 2023

@MartinZikmund Not fixed at all, they released an update and closed it for the x time. Sometimes it works on small apps.

@MartinZikmund MartinZikmund added blocked/vs Categorizes an issue as blocked by a Visual Studio problem kind/tracking-only Categorizes an issue that is currently open for tracking purposes only. and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Sep 5, 2023
@jeromelaban
Copy link
Member Author

It was reported that recent versions of visual studio (17.8 and later) seem to have fixed this particular issue.

@imsam67
Copy link

imsam67 commented Jan 4, 2024

I've now started to experience this problem and I'm on VS 17.8.3. The start up does seem to take longer which makes watchdog kill the app. My setup is an iPhone Xs connected to my laptop via USB. This has been my setup for a long time and everything's been working fine but now startup takes too long and the app crashes.

@bodeg
Copy link

bodeg commented Jan 5, 2024

I'm on VS 17.8.2. with iPhone 6s Plus - fresh new Maui app crash on startup

@Soap-141
Copy link

Soap-141 commented Jan 5, 2024

Yeah def not fix :/

@Soap-141
Copy link

Soap-141 commented Jan 8, 2024

@bodeg Try to delete ~/Library/Caches/Xamarin/XMA/SDK/dotnet/ then connect to your mac with VS, then try to debug your app, this helped someone I know.

@yeahg-dev
Copy link

@bodeg Try to delete ~/Library/Caches/Xamarin/XMA/SDK/dotnet/ then connect to your mac with VS, then try to debug your app, this helped someone I know.

I struggled same issue, and this solution works for me👍 thank you!

@bodeg
Copy link

bodeg commented Jan 12, 2024

@bodeg Try to delete ~/Library/Caches/Xamarin/XMA/SDK/dotnet/ then connect to your mac with VS, then try to debug your app, this helped someone I know.

I struggled same issue, and this solution works for me👍 thank you!

Thanks for sharing.
I am using VS on Windows with a iPhone connected via USB, no Mac involved.

Is that relevant to my configuration?

@yeahg-dev
Copy link

Thanks for sharing. I am using VS on Windows with a iPhone connected via USB, no Mac involved.

Is that relevant to my configuration?

I am using Visual Studio Code on Mac with iPhone connected via USB. It seems to be applied regardless of the development environment.

@bodeg
Copy link

bodeg commented Jan 12, 2024

Thanks for sharing. I am using VS on Windows with a iPhone connected via USB, no Mac involved.
Is that relevant to my configuration?

I am using Visual Studio Code on Mac with iPhone connected via USB. It seems to be applied regardless of the development environment.

I tried deleting the cache files - still not working -> "The app has been terminated."

I deleted
C:\Users###\AppData\Local\Xamarin\iOS

C:\Users###\AppData\Local\Xamarin\iOS\Caches\Xamarin\XMA\Cache
was empty

Also, after the deployment, VS placed an icon on my iPhone.
The application crash when the VS is connected - it runs fine when the VS is not in connected/debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/vs Categorizes an issue as blocked by a Visual Studio problem kind/tracking-only Categorizes an issue that is currently open for tracking purposes only.
Projects
None yet
Development

No branches or pull requests

7 participants