19

Before updating my PC's Visual Studio 2019 (v16.8) I was able to build Xamarin apps and connect to my Mac without issue. After updating to Visual Studio 2019 (v16.9), VS went through the normal process of wanting to update the remote Visual Studio for Mac everything appeared to update without issue, but when trying to connect after the remote update I got an error

"The Xcode license status couldn't be verified because Xcode has not been found on the default location of the connected Mac. Having Xcode installed and functional is necessary in order to build and run iOS apps, so please check that Xcode is correctly installed and that the path specified under iOS Settings is correct."

On the Mac I made sure Xcode and VS for were update to date. (VS had updates which I did), and I still was greeted with the same issue (on windows).

Checking VS for Mac's Preferences Projects->SDK Locations->Apple it shows that it can't find Xcode (it is using a location in /Library/Developer/CommandlineTools/SDKs).

"No SDK found at specified location"

I change that to /Application/Xcode.app which then shows that it can now find it, but requires VS for Mac to be restarted. After doing that, and rechecking the newly set value, I see it has been reverted to the wrong location! No mater what I try, every time I go back to view the setting it always reverts.

I assume I need that pref changed but I can't seem to get the value to stay

Ken
  • 739
  • 5
  • 16

6 Answers6

42

Long story short, this solved my issue

In Mac terminal I ran

sudo xcode-select --reset

Unfortunately I can't find the Xamarin form that lead me to the answer, however I remember it said I needed to install xcode-select sudo xcode-select --install. Doing this errored out because It was already installed

xcode-select: error: command line tools are already installed use "Software Update" to install updates

I tried running Sudo xcode-select --update but that wasn't a valid command. However it did give me a list of valid options where I saw the reset option.

While trying to re-find the original post (I never did find it again) I stumbled upon this stackoverflow post (xcode-select active developer directory error) which I think describes what might have happened. An answer lower on the page (https://stackoverflow.com/a/48154263/13130043) is the same as what I figured out.

Ken
  • 739
  • 5
  • 16
  • Had this issue running Visual Studio 2022 with an Uno Platform project (which is built on top of Xamarin Native) targeting iOS. This sudo command worked beautifully on my Mac Mini (M1) on Monterey. Cheers – Jim Speaker Feb 15 '22 at 11:55
10

You should go to (Tools > Options > Xamarin > iOS Settings) if you're using Visual Studio on Windows. In the Apple SDK section, check the Xcode path there.

Mine also changed to /Library/Developer/CommandlineTools somehow after updating VS to 16.9.0

It works again after changing it to /Applications/Xcode.app

Tony Yu
  • 101
  • 4
  • Just updated my VS after a long time and ran into this. When you change this, VS will accept the SDK and show that green tick, but, project still might not accept it. In that case, CLOSE VS (Not close project, QUIT VS) and start again and load the project again, should work now. – Xonshiz Jun 17 '21 at 16:14
7

Just put a "/" at the end of the url. It works for me.

Ex: "/Applications/Xcode.app/"

0

The error might tell you that the license of xcode could not be verified due to not being able to find xcode...

However, that might as well be not the real reason for the connection issue at all.

Here is another possible solution: Delete the XMA temporary folder from both your Windows PC as well as your MAC and you're good to go.

Windows: %localappdata%\Temp\Xamarin\XMA MacOS: $HOME/Library/Caches/Xamarin/XMA

When pairing your Mac again after this, you can watch the process being busy reinstalling a lot of SDK and Broker stuff. :)

But after all, it should work again.

Mephisztoe
  • 3,276
  • 7
  • 34
  • 48
0

In my case, I were install xcode on desktop after downloading it from https://developer.apple.com/downloads So I get same error.

It solved after moving the xcode to Application directory and run this command on terminal:

sudo xcode-select --reset
Ahmed Shamel
  • 1,982
  • 3
  • 24
  • 58
0

Running the xcode select reset terminal command did not work for me. What I ended up doing was

  1. Close visual studio
  2. Go to %LOCALAPPDATA%\Xamarin\Monotouch
  3. Delete the Monotouch folder
  4. Pair the mac again
ClintL
  • 1,424
  • 14
  • 30