简体   繁体   中英

I can't deploy to either iOS device or simulator in Xamarin Mac

Whatever I choose from the platform-selection dropdown (Debug|iPhoneSimulator, Release|iPhone etc.) the target dropdown stays greyed out and just says "Default" meaning I can't choose either my connected iOS device (tried to connect two different devices) or any iOS simulator target. I know this used to work a couple of months back but since then many Xamarin updates have rolled in..

I have tried both stable and beta channels of Xamarin Studio. I have completely uninstalled Xamarin (using the uninstaller script) and re-installed it. I also updated to macOS Sierra so I've touched pretty many places.

There is an exception in the Xamarin log which I'm pretty sure is the cause of all this but I have no idea how to work around it. The exception is there whether I connect a device or not.

ERROR [2017-01-13 11:12:56Z]: Error while updating status of command: MonoDevelop.Ide.Commands.ProjectCommands.Run
System.InvalidCastException: Specified cast is not valid.
  at MonoDevelop.IPhone.IPhoneProjectFlavor.CreateExecutionCommand (MonoDevelop.Projects.ConfigurationSelector configuration, MonoDevelop.IPhone.IPhoneProjectFlavor appProject, MonoDevelop.IPhone.IPhoneProjectConfiguration appCfg, MonoDevelop.IPhone.IPhoneProjectFlavor targetProject, MonoDevelop.IPhone.IPhoneProjectConfiguration targetCfg, MonoDevelop.Projects.RunConfiguration runConfiguration) [0x0014d] in /Users/builder/data/lanes/3509/e606823f/source/md-addins/MonoDevelop.IPhone/MonoDevelop.IPhone/Project/IPhoneProject.cs:885 
  at MonoDevelop.IPhone.IPhoneProjectFlavor.OnGetCanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration, MonoDevelop.Projects.SolutionItemRunConfiguration runConfiguration) [0x0001a] in /Users/builder/data/lanes/3509/e606823f/source/md-addins/MonoDevelop.IPhone/MonoDevelop.IPhone/Project/IPhoneProject.cs:807 
  at MonoDevelop.Projects.SolutionItemExtension.OnGetCanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00000] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemExtension.cs:228 
  at MonoDevelop.Projects.SolutionItemExtension.OnGetCanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration, MonoDevelop.Projects.SolutionItemRunConfiguration runConfiguration) [0x00007] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItemExtension.cs:251 
  at MonoDevelop.Projects.SolutionItem.CanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration, MonoDevelop.Projects.SolutionItemRunConfiguration runConfiguration) [0x00000] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionItem.cs:973 
  at MonoDevelop.Projects.Solution.OnGetCanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration, MonoDevelop.Projects.SolutionRunConfiguration runConfiguration) [0x0000d] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs:819 
  at MonoDevelop.Projects.Solution+DefaultSolutionExtension.CanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration, MonoDevelop.Projects.SolutionRunConfiguration runConfiguration) [0x00000] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs:1243 
  at MonoDevelop.Projects.SolutionExtension.CanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00000] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionExtension.cs:79 
  at MonoDevelop.Projects.SolutionExtension.CanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration, MonoDevelop.Projects.SolutionRunConfiguration runConfiguration) [0x00007] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionExtension.cs:102 
  at MonoDevelop.Projects.SolutionExtension.CanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00000] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionExtension.cs:79 
  at MonoDevelop.Projects.SolutionExtension.CanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration, MonoDevelop.Projects.SolutionRunConfiguration runConfiguration) [0x00007] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionExtension.cs:102 
  at MonoDevelop.Projects.Solution.CanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration, MonoDevelop.Projects.SolutionRunConfiguration runConfiguration) [0x00000] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs:732 
  at MonoDevelop.Projects.Solution.CanExecute (MonoDevelop.Projects.ExecutionContext context, MonoDevelop.Projects.ConfigurationSelector configuration) [0x00000] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs:722 
  at MonoDevelop.Ide.ProjectOperations.CanExecute (MonoDevelop.Projects.IBuildTarget entry, MonoDevelop.Core.Execution.IExecutionHandler handler) [0x00020] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs:993 
  at MonoDevelop.Ide.Commands.RunHandler.CanRun (MonoDevelop.Core.Execution.IExecutionHandler executionHandler) [0x00015] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs:254 
  at MonoDevelop.Ide.Commands.RunHandler.Update (MonoDevelop.Components.Commands.CommandInfo info) [0x00048] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ProjectCommands.cs:242 
  at MonoDevelop.Components.Commands.CommandHandler.InternalUpdate (MonoDevelop.Components.Commands.CommandInfo info) [0x00000] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs:42 
  at MonoDevelop.Components.Commands.CommandManager.DefaultUpdateCommandInfo (MonoDevelop.Components.Commands.ActionCommand cmd, MonoDevelop.Components.Commands.CommandInfo info) [0x00079] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1518 
  at MonoDevelop.Components.Commands.CommandManager.GetCommandInfo (System.Object commandId, MonoDevelop.Components.Commands.CommandTargetRoute targetRoute) [0x001cf] in /Users/builder/data/lanes/3509/e606823f/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1483 

Seems that disabling these Unity Add-ins fixes this issue:

  • Mono Soft Debugger Support for Unity
  • Utilities for use with Unity

There is a bug report at https://bugzilla.xamarin.com/show_bug.cgi?id=51517

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM