xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.46k stars 511 forks source link

watchOS label's setText does not work #4847

Closed adejewski closed 6 years ago

adejewski commented 6 years ago

Steps to Reproduce

  1. Download example from https://github.com/xamarin/ios-samples/tree/master/watchOS/WatchConnectivity
  2. Compile and run, check if clicking on iPhone updates watchOS label

Tested on iPhone 5s(ios 12), Apple Watch genration 1(WatchOS 4.3.2) and on simulator.

Expected Behavior

setText should update label's text

Actual Behavior

Does nothing

Environment

Microsoft Visual Studio Enterprise 2017  (2)
Version 15.8.4
VisualStudio.15.Release/15.8.4+28010.2026
Microsoft .NET Framework
Version 4.7.03056

Installed Version: Enterprise

Architecture Diagrams and Analysis Tools   00369-90019-84418-AA222
Microsoft Architecture Diagrams and Analysis Tools

Visual C++ 2017   00369-90019-84418-AA222
Microsoft Visual C++ 2017

Application Insights Tools for Visual Studio Package   8.13.10627.1
Application Insights Tools for Visual Studio

C# Tools   2.9.0-beta8-63208-01
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus   1.1.49 (remotes/origin/d15-8@ee674f3)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

JetBrains ReSharper Ultimate 2018.1.3    Build 112.0.20180626.160528
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright Β© 2018 JetBrains, Inc.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

MLGen Package Extension   1.0
MLGen Package Visual Studio Extension Detailed Info

Mono Debugging for Visual Studio   4.11.8-pre (009db7d)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   4.6.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

Visual Basic Tools   2.9.0-beta8-63208-01
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.2 for F# 4.5   15.8.0.0.  Commit Hash: c55dd2c3d618eb93a8d16e503947342b1fa93556.
Microsoft Visual F# Tools 10.2 for F# 4.5

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Universal Windows Apps   15.0.28010.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   4.11.0.756 (d15-8@b66ff7180)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   4.14.221 (a73ca07f7)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   1.1.116 (9619170)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   9.0.0.19 (HEAD/a8a3b0ec7)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   11.14.0.13 (373c313)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Build Logs

1>------ Rebuild All started: Project: WatchConnectivity.OnWatchExtension, Configuration: Debug iPhoneSimulator ------
1>  Connecting to Mac server 192.168.50.103...
1>  Detected signing identity:
1>    Bundle Id: com.xamarin.WatchConnectivity.watchkitapp.watchkitextension
1>    App Id: com.xamarin.WatchConnectivity.watchkitapp.watchkitextension
1>  Connecting to Mac server 192.168.50.103...
1>  Detected signing identity:
1>    Bundle Id: com.xamarin.WatchConnectivity.watchkitapp.watchkitextension
1>    App Id: com.xamarin.WatchConnectivity.watchkitapp.watchkitextension
1>C:\Users\aleks\Documents\WatchConnectivity\WatchConnectivity.OnWatchExtension\SessionManager\WCSessionManager.cs(91,33,91,102): warning CS0618: 'NSDictionary<NSString, NSObject>.FromObjectsAndKeys(NSString[], NSObject[])' is obsolete: ''TKey' and 'TValue' are inversed and won't work unless both types are identical. Use the generic overload that takes a count parameter instead.'
1>  WatchConnectivity.OnWatchExtension -> C:\Users\aleks\Documents\WatchConnectivity\WatchConnectivity.OnWatchExtension\bin\iPhoneSimulator\Debug\WatchConnectivityOnWatchExtension.dll
2>------ Rebuild All started: Project: WatchConnectivity.OnWatch, Configuration: Debug iPhoneSimulator ------
2>  Connecting to Mac server 192.168.50.103...
2>  Connecting to Mac server 192.168.50.103...
2>F:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(1328,3): warning : Glance Interfaces were removed in watchOS 3.0
2>F:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(1215,3): warning : The app icon set "AppIcon" has an unassigned child.
2>  WatchConnectivity.OnWatch -> C:\Users\aleks\Documents\WatchConnectivity\WatchConnectivity.OnWatch\bin\iPhoneSimulator\Debug\WatchConnectivityOnWatch.dll
2>  Detected signing identity:
2>    Bundle Id: com.xamarin.WatchConnectivity.watchkitapp
2>    App Id: com.xamarin.WatchConnectivity.watchkitapp
3>------ Rebuild All started: Project: WatchConnectivity, Configuration: Debug iPhoneSimulator ------
3>  Connecting to Mac server 192.168.50.103...
3>  Connecting to Mac server 192.168.50.103...
3>F:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(1215,3): warning : The app icon set "AppIcon" has an unassigned child.
3>C:\Users\aleks\Documents\WatchConnectivity\WatchConnectivity.OnWatchExtension\SessionManager\WCSessionManager.cs(91,33,91,102): warning CS0618: 'NSDictionary<NSString, NSObject>.FromObjectsAndKeys(NSString[], NSObject[])' is obsolete: ''TKey' and 'TValue' are inversed and won't work unless both types are identical. Use the generic overload that takes a count parameter instead.'
3>  WatchConnectivity -> C:\Users\aleks\Documents\WatchConnectivity\WatchConnectivity\bin\iPhoneSimulator\Debug\WatchConnectivity.exe
3>  Detected signing identity:
3>    Bundle Id: com.xamarin.WatchConnectivity
3>    App Id: com.xamarin.WatchConnectivity
========== Rebuild All: 3 succeeded, 0 failed, 0 skipped ==========

Example Project (If Possible)

https://github.com/xamarin/ios-samples/tree/master/watchOS/WatchConnectivity

rolfbjarne commented 6 years ago

@kolegs I just tested this in the simulator, and it works fine for me (the only point is that sometimes it can take 10-15 seconds for the first message to get through to the other device).

Can you create a screencast of how it looks for you and attach the Application Output?

Do you get updates in one direction, but not the other, or are both directions blocked?

settext-2

VincentDondain commented 6 years ago

We have not received the requested information.

If you are still experiencing this issue please provide all the requested information then click the Reopen Issue button.

Thanks!