Why does Manual Provisioning keep switching back to Automatic when I re-open the Solution?

EasyGoingPatEasyGoingPat GBMember ✭✭✭

I am using Manual Provisioning for an iOS/WatchOS application (because Automatic simply will not work; it cannot even find my Team which is working fine in XCode on the Mac).

The Manual Provisioning did work fine one afternoon. Then, when I re-opened the solution the next day, without touching a line of code, it stopped working. Actually, that is not entirely true. My build still works okay, and I can run the iOS part of the application, but I cannot deploy to the Watch. The Watch does not even appear in the list of target devices when running.

I don't know what is wrong, but one thing I find odd is that the iOS Bundle Signing tab in Visual Studio keeps going back to Automatic Provisioning. Actually, this is not quite true either: the radio button at the top of the screen stays on Manual but the Manual Provisioning drop-downs below go back to Developer (Automatic), Automatic, with no Custom Entitlements selected.

If anyone is on here from Xamarin, please offer some input on this. I haven't written a line of code in over a week because of this. I am seriously having to consider dropping the entire Xamarin platform. I am now at the point where the only thing I can think of to try is a complete reinstall of my entire development environment. After that, I am looking at a complete reinstall of Windows itself, to wipe all settings (though I might have hung myself before then).

  • Patrick

Best Answer

Answers

  • PierceBogganPierceBoggan USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    @EasyGoingPat: I reached out to a member of our engineering team for follow-up.

  • PierceBogganPierceBoggan USForum Administrator, Xamarin Team, Developer Group Leader Xamurai
    edited June 2018

    @EasyGoingPat: I followed up with the team. This problem should be fixed in the next Visual Studio 2017 version 15.8 preview!

    Edit: Would you be interested in a patched version of Visual Studio 2017 version 15.7 with this fix?

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @PierceBoggan That's such a relief to know! I have to work on a non-Xamarin project for the next 2-3 days, but if the ETA on V15.8 is later than next Monday then, yes, definitely, I'd like to try a patch.

    • Patrick
  • PierceBogganPierceBoggan USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    Awesome, I'll have the team pull together a patched 15.7 for you.

  • PierceBogganPierceBoggan USForum Administrator, Xamarin Team, Developer Group Leader Xamurai
  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @PierceBoggan

    Hi,

    Thanks for that.

    I installed it and it did reinstate my Tools | Options | Xamarin | Apple Accounts option. I was able to re-enter my AppleID and the iOS project then found my Team and signed in.

    Unfortunately, when I tried to build, I get the errors below. These appear to be caused by the fact that the newly created Xamarin.Forms project does not have a reference to this in the iOS project. I don't know how to fix this because when I open the Project | References dialog, Xamarin.Forms is not listed anywhere that I can find.

    If I now do a repair or maybe reinstall the normal version of Xamarin, I don't suppose it might miraculously put me back where I was but with a working connection to my Apple Developer account?

    • Patrick

      1>------ Rebuild All started: Project: Serenocalm.Forms.iOS, Configuration: Debug iPhone ------
      1> Connecting to Mac server MacBook...
      1> Connecting to Mac server MacBook...
      1>\Serenocalm.Forms\App.xaml.cs(5,12,5,27): error CS0246: The type or namespace name 'XamlCompilationAttribute' could not be found (are you missing a using directive or an assembly reference?)
      1>\Serenocalm.Forms\App.xaml.cs(5,12,5,27): error CS0246: The type or namespace name 'XamlCompilation' could not be found (are you missing a using directive or an assembly reference?)
      1>\Serenocalm.Forms\App.xaml.cs(5,29,5,51): error CS0103: The name 'XamlCompilationOptions' does not exist in the current context
      1>\Serenocalm.Forms\App.xaml.cs(2,15,2,20): error CS0234: The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?)
      1>\Serenocalm.Forms\App.xaml.cs(3,15,3,20): error CS0234: The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?)
      1>\Serenocalm.Forms\MainPage.xaml.cs(6,15,6,20): error CS0234: The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?)
      1>\Serenocalm.Forms\App.xaml.cs(8,29,8,40): error CS0246: The type or namespace name 'Application' could not be found (are you missing a using directive or an assembly reference?)
      1>\Serenocalm.Forms.iOS\AppDelegate.cs(14,56,14,61): error CS0234: The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?)
      1>\Serenocalm.Forms\MainPage.xaml.cs(10,34,10,45): error CS0246: The type or namespace name 'ContentPage' could not be found (are you missing a using directive or an assembly reference?)
      1>\Serenocalm.Forms.iOS\AppDelegate.cs(23,30,23,47): error CS0115: 'AppDelegate.FinishedLaunching(UIApplication, NSDictionary)': no suitable method found to override
      1>\Serenocalm.Forms\App.xaml.cs(17,27,17,34): error CS0115: 'App.OnStart()': no suitable method found to override
      1>\Serenocalm.Forms\App.xaml.cs(22,27,22,34): error CS0115: 'App.OnSleep()': no suitable method found to override
      1>\Serenocalm.Forms\App.xaml.cs(27,27,27,35): error CS0115: 'App.OnResume()': no suitable method found to override
      ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @PierceBoggan

    Mmm... perhaps foolishly, I did try what I said. I uninstalled and reinstalled Xamarin. Then I had to restore Xamarin.Forms as a nuget package to fix the build error above. This now connects and builds on the Mac but when I try to run it, it appears to do nothing at all. My phone appears correctly in the run-target at the top of Visual Studio but nothing appears in the output window when I try to run and the application doesn't deploy.

    Unless you have any ideas, Pierce, I think I may be looking at a complete reinstall of everything and recreation of the project. But I am inclined to wait until the changes you gave me in the alpha make into the main channel. Do you have any idea when that might be?

    I know it's not your fault, Pierce, but I have now wasted a huge amount of time on this. It's getting pretty scary!

    • Patrick
  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @PierceBoggan

    I have got the whole thing building now - even my WatchOS application and extension. The Automatic Provisioning worked a treat!

    My last remaining problem is unfortunately the one that first led me down this dark path: even though XCode quite happily sees my connected Apple Watch, it stubbornly refuses to appear as a debug device in Visual Studio on the PC. Problem is that this is just as much of a deal breaker as any of the other stuff. I still can't do any work.

    • Patrick
  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @PierceBoggan

    Still cannot get Visual Studio on Windows to see the paired Apple Watch. One thing I have noticed is that the icon on the reference to the WatchApp in the parent iOS application has a warning triangle against it. So far, I haven't been able to find out what this means.

    Any ideas?

    • Patrick
  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @PierceBoggan

    Just discovered the following error in the logs. Don't know if it is relevant. Have even less idea how to fix it.

    Strange thing is that I can debug the parent iPhone application fine. The parent application and the watch use different debug ports don't they? Could it be that the latter is blocked? How do I check/unblock it?

    Any ideas, pretty please?

    System.Net.Mqtt.Sdk.Bindings.TcpChannelFactory|Error|0|An error occurred while connecting via TCP to the endpoint address MacBook and port 50534, to establish an MQTT connection
    System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 192.168.0.2:50534

  • PierceBogganPierceBoggan USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    @EasyGoingPat: Apologies on the slow response. Been traveling for work and on vacation. What version is your Apple Watch running? I've seen this happen when using a watch with a watchOS version older than the deployment target set in VS. If you right-click the watchOS project, go to Properties, and then look at the deployment target version, is your watch at least that version?

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @PierceBoggan Thanks for the suggestion. I've been randomly trying versions for a few hours now. Nothing seems to make any difference. Don't know how to proceed with this. Any ideas? Any chance of getting someone at Xamarin to look at my log files?

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @PierceBoggan Well, I have managed to go backwards. I followed the steps on the Mac Build Host Troubleshooting page and now I can't even deploy the iPhone application. I get:

    Launch failed. The app 'Serenocalm.Forms.iOS' could not be launched on 'Patrick Skelton’s iPhone'. Error: error MT1006: Could not install the application '/Users/patrick/Library/Caches/Xamarin/mtbs/builds/Serenocalm.Forms.iOS/7910b3da1bc2793656928e50339b51e4/bin/iPhone/Debug/Serenocalm.Forms.iOS.app' on the device 'Patrick Skelton’s iPhone': Read Error (error: 0xe8000004).. Please check the logs for more details.

    This is madness. In thirty years of development, I have never wasted so much time simply trying to get the development environment working. I don't know what kind of test setup you guys at Xamarin have (I can't imagine you all have physical iPhones and Apple watches on your desks) but has anyone verified recently that the supplied WatchOS project will build and deploy to a physical device?

    Sorry, Pierce, rant over. Any help you can dig up would be desperately received.

    • Patrick
  • PierceBogganPierceBoggan USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    I'm on vacation, but have forwarded this along to another member on the team.

    Can you attach the logs that are mentioned in the error message? I believe they are in Help > Xamarin > Zip Logs (Last 7 days).

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    Thanks @PierceBoggan !

    I have attached the logs. Please note that the most recent ones (from about 1600 GMT on 12/06/18) will show errors relating to the iPhone itself, not just the Watch. The reason for this is that - as I mentioned above - I went through the Mac Connection Troubleshooter and now can't even deploy the iPhone part of the application.

    I am about to uninstall Xamarin and XCode and recreate the Xamarin Sample WatchOS Solution from scratch to see if I can at least get back to where I was.

    Thanks for your help and enjoy your hols!

    Kind wishes ~ Patrick

  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @PierceBoggan

    Doh! I have just realised, Pierce, that I don't think I included logs for the last seven days. I have attached them to this. Note though that I have just completed a complete reinstall, so the most recent entries (almost all dated 12th June) have been generated after the reinstall of Xamarin.

    • Patrick
  • EasyGoingPatEasyGoingPat GBMember ✭✭✭

    @PierceBoggan

    Don't mean to be a nuisance, Pierce, but I have not heard any follow-up to this yet. Still haven't managed to get a Watch connection from Visual Studio on PC.

    • Patrick
Sign In or Register to comment.