1

I am trying to create a watchOS app in an existing Xamarin Forms application in Visual Studio 2017 on Windows. I have followed all the steps listed here. I have also added watchOS app project reference to the main iOS app by selecting add reference option of the references node of the main iOS app. Solution also builds successfully but when I try to launch watchOS app in watch simulator, it instantly throws the below error without even launching the simulator.

Error: Main iOS app couldn't be found, please make sure you've created an iOS app and it is referencing

Please suggest what I am doing wrong.

Tisha Anand
  • 309
  • 5
  • 18

1 Answers1

1

I think you have add the watchOS app reference in a wrong place.

You should add the reference in xxx.iOS projecct instead of xxx(xamarin.forms project).

Let me show a screenshot for you:

reference

Update:

Steps:

  1. I create a new MobileApp(Xamarin.forms) project(platform iOS).

  2. Right click on the solution -->add --> new project -->Apple Watch -->watchOS app-->ok.

  3. Right click on the xxx.iOS project --> add---> reference --> check XXX.watchOSApp

    refer

  4. Right click on the xxx.WatchOSApp --> Set as Setup Project.

  5. (Clean and rebuild) Run on the appleWatch simulator.
nevermore
  • 15,432
  • 1
  • 12
  • 30
  • Thank you Jack for your response. I have already mentioned that watchOS app reference is added to the main iOS app as you mentioned please. One more thing in your screenshot, why there is yellow exclamation mark against the reference? How did you add the reference? Can you please tell me the way you added the reference please? – Tisha Anand Apr 19 '19 at 04:02
  • @TishaAnand I added my steps, please check. – nevermore Apr 19 '19 at 05:40
  • I have carried same steps as mentioned by you but with no success. Sorry for the late reply. – Tisha Anand Apr 22 '19 at 04:02
  • @TishaAnand Did you use a new project? Can you upload your project so that I can check it for you. – nevermore Apr 22 '19 at 05:18
  • Watch kit app is added to an existing project. I am not able to upload the solution as it is a client project – Tisha Anand Apr 22 '19 at 05:35
  • @TishaAnand Can you try add it in a new project and check if it works? If it works, it may caused some setting of the existing project. If not, maybe other reasons. – nevermore Apr 22 '19 at 05:37
  • @TishaAnand Can you upload your project with new project? – nevermore Apr 22 '19 at 05:52
  • I can do it from my home pls. It will take some hours – Tisha Anand Apr 22 '19 at 05:53
  • No problem. I will check it once you upload it. – nevermore Apr 22 '19 at 05:55