Bug 29912 - Adding WatchKit app to existing iOS project fails to run
Summary: Adding WatchKit app to existing iOS project fails to run
Status: RESOLVED DUPLICATE of bug 28752
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.10
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-05-10 04:41 UTC by srobbins103
Modified: 2016-02-29 14:35 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 28752

Description srobbins103 2015-05-10 04:41:17 UTC
I've added the projects and checked the references and bundleIDs as shown on http://developer.xamarin.com/guides/ios/watch/installation/ however, when I run the extension project, nothing actually runs on the simulator and nothing appears in the "Application Output" window. I just get "waiting for debugger to connect".
If I run the WatchKitCatalog sample, it works perfectly, so I guess there's something missing. I then tried adding the Extension and App from the WatchKitCatalog sample to my solution (changing bundle IDs and references as appropriate), but it fails. 
I tried asking the community and someone else had a similar problem - see https://forums.xamarin.com/discussion/comment/121823 - is there something missing in existing projects maybe?
I have XS 5.9.431 and Xamarin.iOS 8.10.0.267 and the project I'm adding the watch app to uses Xamarin Forms (1.4.2.6355) - let me know if more info would be useful.
Thanks,
Steve
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-05-11 04:10:48 UTC
Could you zip up and attach your project so that we can look at it? That would be the quickest way for us to figure out what's happening.
Comment 2 srobbins103 2015-05-21 16:27:28 UTC
I've sent an email to Rolf with the project zipped up rather than putting it here.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2015-05-22 05:07:15 UTC
I didn't get anything (it was probably blocked due to executable contents).

Can you upload to a file-sharing service (like Dropbox) and share that link instead?
Comment 4 srobbins103 2015-05-22 11:05:34 UTC
Hi Rolf,
I'm pleased to say that I've managed to recreate the problem in a separate project now!

I believe that there is a conflict with the MS BCL Build targets, having a project reference to a PCL project and then trying to include an Extension assembly.

If you pull this repo: https://github.com/srgb/watchkitproblem you should be able to run the watchkit app in the simulator.

If you then reset to this commit: https://github.com/srgb/watchkitproblem/commit/990a98878aee3e079e64c33181ae291fa128c5a2 - which would be the same as uncommenting line 154 of the iOS project: https://github.com/srgb/watchkitproblem/blob/master/iOS/watchtest.iOS.csproj#L154 and redeploy the app, you should see that the watch extension is not packaged properly and the debugger sits in the "waiting to connect" state.
My testing seems to show that the problem also goes away if there are no other project references (i.e. apart from the watchkit extension).

I believe (but haven't proven as fully) that this applies to any type of iOS extension packaging as during my testing, I was trying a Today extension as an alternative to the watch extension and it seems to be the same.

I have proven this with three projects I have, so I hope this helps you track this down; don't hesitate to contact me if you need clarification or more info. For now, I have the workaround of commenting out the BCL.Build targets
Comment 5 Rolf Bjarne Kvinge [MSFT] 2015-05-25 06:21:28 UTC
Thanks for the diagnosis! We've already fixed this, and it'll be included in the next service release (which is already in the beta channel).

*** This bug has been marked as a duplicate of bug 28752 ***
Comment 6 srobbins103 2015-05-25 06:26:24 UTC
Thanks Rolf - I should have said that during the lifetime of this bug I updated to the latest beta version and still have the problem. I now have Xamarin.iOS 8.10.1.59 and XS 5.9.2 (build 2). Can you tell me which version to look out for please?
Thanks,
Steve
Comment 7 Rolf Bjarne Kvinge [MSFT] 2015-05-25 06:32:22 UTC
From what I can see the fix should be in those versions.

Can you try the workaround mentioned here: https://bugzilla.xamarin.com/show_bug.cgi?id=28752#c7 and see if that works for you?
Comment 8 edgeric 2015-05-26 08:01:31 UTC
Updating to the Beta channel fixed the Watch app issue in my project. Thanks Rolf.
Comment 9 edgeric 2015-05-26 09:49:56 UTC
Actually, while the debugger connected, any updates to the watchapp storyboard are not working now
Comment 10 srobbins103 2015-05-27 15:36:59 UTC
@Rolf, the workaround does work, yes - however, using the current beta channel without that workaround, this is not fixed that I can see.
Comment 11 srobbins103 2015-05-27 16:16:15 UTC
Actually, same as edgeric, with BCL in at all, that last version is constantly used and changes are not taken in.