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 launch watchOS app on M1 machines #10665

Open
tipa opened this issue Feb 18, 2021 · 12 comments
Open

Cannot launch watchOS app on M1 machines #10665

tipa opened this issue Feb 18, 2021 · 12 comments
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting Xamarin.iOS watchOS
Milestone

Comments

@tipa
Copy link

tipa commented Feb 18, 2021

Steps to Reproduce

  • Download the demo project from here
  • Open the solution
  • Select "WatchApp3" in configuration "Debug"
  • SelectApple Watch 6Series 6 - 44mm watchOS 7.2
  • Try to debug

Expected Behavior

watchOS and iOS simulators start up and app launches

Actual Behavior

watchOS and iOS simulators start up but this error shows up:
error HE0046: Failed to install the app 'com.xamarin.WatchKitCatalogDemo.watchkitapp' on the device 'watchOS 7.2 (18S561) - Apple Watch Series 6 - 44mm': ???WatchKitCatalog??? Needs To Be Updated

Environment

=== Visual Studio Community 2019 for Mac ===

Version 8.8.9 (build 10)
Installation UUID: 8287b702-6fe7-4efe-8d21-18f545409ad5
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000107

=== Mono Framework MDK ===

Runtime:
	Mono 6.12.0.122 (2020-02/c621c35ffa0) (64-bit)
	Package version: 612000107

=== Roslyn (Language Service) ===

3.8.0-5.20519.18+4c195c3ac1974edcefa76774d7a59a2350ec55fa

=== NuGet ===

Version: 5.8.0.6860

=== .NET Core SDK ===

SDK: Not installed
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: Not installed

=== .NET Core 3.1 SDK ===

SDK: Not installed

=== Xamarin.Profiler ===

Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.4 (17801)
Build 12D4e

=== Xamarin.Mac ===

Version: 7.4.0.4 (Visual Studio Community)
Hash: 5a05865f6
Branch: xcode12.4
Build date: 2021-01-28 02:30:22-0500

=== Xamarin.iOS ===

Version: 14.10.0.4 (Visual Studio Community)
Hash: 5a05865f6
Branch: xcode12.4
Build date: 2021-01-28 02:30:23-0500

=== Xamarin Designer ===

Version: 16.8.0.510
Hash: 44e3f3ce9
Branch: remotes/origin/d16-8
Build date: 2020-12-10 00:06:14 UTC

=== Xamarin.Android ===

Not Installed

=== Microsoft OpenJDK for Mobile ===

Java SDK: Not Found

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.8.0.32
Hash: 01a7774
Branch: remotes/origin/d16-8
Build date: 2021-01-14 00:34:58 UTC

=== Android Device Manager ===

Version: 16.8.0.46
Hash: 0a81419
Branch: remotes/origin/d16-8
Build date: 2021-01-14 00:35:22 UTC

=== Build Information ===

Release ID: 808090010
Git revision: 0061f975f58a5dba53e339f116371f4853edeb75
Build date: 2021-02-11 11:16:18-05
Build branch: release-8.8
Xamarin extensions: 0061f975f58a5dba53e339f116371f4853edeb75

=== Operating System ===

Mac OS X 10.16.0
Darwin 20.3.0 Darwin Kernel Version 20.3.0
    Thu Jan 21 00:06:51 PST 2021
    root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 x86_64


Example Project (If Possible)

https://docs.microsoft.com/en-us/samples/xamarin/ios-samples/watchos-watchkitcatalog/

@rolfbjarne
Copy link
Member

Can you try opening the project properties for the WatchKit3Extension project, and in the "watchOS Build" page, set "Supported architectures" to i386 + x86_64 and see if that works for you?

@rolfbjarne rolfbjarne added bug If an issue is a bug or a pull request a bug fix iOS Issues affecting Xamarin.iOS labels Feb 19, 2021
@rolfbjarne rolfbjarne added this to the Future milestone Feb 19, 2021
@rolfbjarne rolfbjarne added the need-info Waiting for more information before the bug can be investigated label Feb 19, 2021
@tipa
Copy link
Author

tipa commented Feb 19, 2021

Thanks for your quick reply.
Now I am getting this error/crash:
2021-02-19 21:27:06.703238+0100 Watchkit2Extension[4043:155636] [default] -[SPApplicationDelegate _terminateWK1App:]:751: WatchKit 1 apps aren't supported on this version of watchOS. Quitting "(null)"
I suggest fixing that demo project, it is referenced in the "Getting started" docs: https://docs.microsoft.com/en-us/xamarin/ios/watchos/get-started/installation

@rolfbjarne
Copy link
Member

@tipa is that with the same sample (https://docs.microsoft.com/en-us/samples/xamarin/ios-samples/watchos-watchkitcatalog/)? Because I just tried downloading that sample, changing the architectures to i386 + x86_64, and I was able to launch in the watch simulator (with watchOS 7.2).

@tipa
Copy link
Author

tipa commented Feb 23, 2021

@rolfbjarne yes, this project. I just downloaded it again from scratch, changed the architecture and nothing else - same error. App seems to start up for 2 secs, then crashes/closes

2021-02-23 15:02:09.030451+0100 Watchkit2Extension[26209:701048] [default] lookupMainFuncAddressInMachHeader:48: Could not find matching binary in dyld list
2021-02-23 15:02:09.038714+0100 Watchkit2Extension[26209:701048] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=26209
2021-02-23 15:02:09.039429+0100 Watchkit2Extension[26209:701048] SecTaskCopyDebugDescription: Watchkit2Extensi[26209]/0#-1 LF=0
2021-02-23 15:02:09.118576+0100 Watchkit2Extension[26209:701048] [db] _LSSchemaConfigureForStore failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xf594fc2f f09d184e dedab11d f2e17489 ... 49c66730 2b30a8b8 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x31cd89fe 3a124cd3 dbc2f4bf 8b829bed ... bca61032 d52c63a2 }}
2021-02-23 15:02:09.119211+0100 Watchkit2Extension[26209:701048] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xf594fc2f f09d184e dedab11d f2e17489 ... 49c66730 2b30a8b8 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x31cd89fe 3a124cd3 dbc2f4bf 8b829bed ... bca61032 d52c63a2 }}
2021-02-23 15:02:09.127596+0100 Watchkit2Extension[26209:701048] [db] _LSSchemaConfigureForStore failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xf594fc2f f09d184e dedab11d f2e17489 ... 49c66730 2b30a8b8 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x31cd89fe 3a124cd3 dbc2f4bf 8b829bed ... bca61032 d52c63a2 }}
2021-02-23 15:02:09.127719+0100 Watchkit2Extension[26209:701048] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xf594fc2f f09d184e dedab11d f2e17489 ... 49c66730 2b30a8b8 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x31cd89fe 3a124cd3 dbc2f4bf 8b829bed ... bca61032 d52c63a2 }}
2021-02-23 15:02:09.172937+0100 Watchkit2Extension[26209:701048] [db] _LSSchemaConfigureForStore failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xf594fc2f f09d184e dedab11d f2e17489 ... 49c66730 2b30a8b8 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x31cd89fe 3a124cd3 dbc2f4bf 8b829bed ... bca61032 d52c63a2 }}
2021-02-23 15:02:09.173055+0100 Watchkit2Extension[26209:701048] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xf594fc2f f09d184e dedab11d f2e17489 ... 49c66730 2b30a8b8 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x31cd89fe 3a124cd3 dbc2f4bf 8b829bed ... bca61032 d52c63a2 }}
2021-02-23 15:02:09.187951+0100 Watchkit2Extension[26209:701048] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=26209
2021-02-23 15:02:09.188190+0100 Watchkit2Extension[26209:701048] SecTaskCopyDebugDescription: Watchkit2Extensi[26209]/0#-1 LF=0
2021-02-23 15:02:09.236986+0100 Watchkit2Extension[26209:701048] [db] _LSSchemaConfigureForStore failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xf594fc2f f09d184e dedab11d f2e17489 ... 49c66730 2b30a8b8 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x31cd89fe 3a124cd3 dbc2f4bf 8b829bed ... bca61032 d52c63a2 }}
2021-02-23 15:02:09.237108+0100 Watchkit2Extension[26209:701048] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xf594fc2f f09d184e dedab11d f2e17489 ... 49c66730 2b30a8b8 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x31cd89fe 3a124cd3 dbc2f4bf 8b829bed ... bca61032 d52c63a2 }}
2021-02-23 15:02:09.237583+0100 Watchkit2Extension[26209:701048] [default] -[SPApplicationDelegate _terminateWK1App:]:751: WatchKit 1 apps aren't supported on this version of watchOS. Quitting "(null)"

@rolfbjarne
Copy link
Member

Turns out I can repro on an M1 machine, but not on Intel machines.

@rolfbjarne rolfbjarne removed the need-info Waiting for more information before the bug can be investigated label Feb 23, 2021
@Harshadcse
Copy link

@rolfbjarne: Yes correct. M1 machine not able to run but intel machine works fine. Can you please find the solution for the M1 Machine?

@rolfbjarne rolfbjarne changed the title Cannot launch watchOS app Cannot launch watchOS app on M1 machines Apr 19, 2021
@Reiszecke
Copy link

Reiszecke commented Jun 22, 2021

Can someone confirm whether it's actually possible to run WatchKit apps on M1? I found https://stackoverflow.com/questions/66657154/are-m1-macs-able-to-run-watch-apps claiming the contrary

If it even fails in Xcode, xamarin has no chance

@DamianMehers
Copy link

Can someone confirm whether it's actually possible to run WatchKit apps on M1? I found https://stackoverflow.com/questions/66657154/are-m1-macs-able-to-run-watch-apps claiming the contrary

If it even fails in Xcode, xamarin has no chance

I'm pretty sure I was running WatchOS apps on both the Simulator (definitely) and real devices. In Xcode 12 it was flaky, the Xcode 13 betas are much better - debugging apps on real devices in the Xcode 13 beta is much more fast and reliable.

@CarlosPolastro
Copy link

CarlosPolastro commented Nov 4, 2021

Hi @rolfbjarne!
Is there any workaround?
I recently updated to a Mac M1 and now I'm really stuck in this issue.
Tks!

@SprengerS
Copy link

I also changed to M1 Pro Macbook and I'm facing the same issue. Now it is not possible to develop an iOS Watch App with M1 neither on a Simulator nor on real device (#8810). This is maximum frustrating and there seems to be no changes in the future.

@rolfbjarne Can you tell me who is the manager and take care about the development of Xamarin for supporting Apple Watch.

So I would come to the decision, that Xamarin is not the future of mobile development. Does this work in VS Mac 2022 Preview with MAUI?

@CarlosPolastro
Copy link

Hi @DamianMehers!
Please let us know if this issue will be fixed and when.
I have a WatchOs project that cannot be used in any way (Tried in Visual Studio for Mac 2019 and 2022).
Not sure whether Microsoft is focusing on WatchOS support any more.

@DamianMehers
Copy link

Hi @DamianMehers!
Please let us know if this issue will be fixed and when.
I have a WatchOs project that cannot be used in any way (Tried in Visual Studio for Mac 2019 and 2022).
Not sure whether Microsoft is focusing on WatchOS support any more.

I'm afraid I've moved from using .NET/C# to using Swift and SwiftUI for my Apple Watch and iOS apps :-(. With .NET MAUI, Apple Watch support has been dropped, at least in the initial release.

Just in case it wasn't clear, I'm just a developer using the tools like you, I don't work for Microsoft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting Xamarin.iOS watchOS
Projects
None yet
Development

No branches or pull requests

7 participants