I just updated visual Studio for Mac to 8.8 (build 1651) and now I'm getting this build error.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Shared.targets(3,3): Error: Could not find a valid Xcode app bundle at '/Applications/Xcode.app/Contents/Developer/'. Please update your Apple SDK location in Visual Studio's preferences (Projects > SDK Locations > Apple > Apple SDK).
(HPPageLiftProxy.OSX)
In VS Preferences, this is what it's showing.
I'm down . How do I fix this?
Thanks
Here's my current environment:
=== Visual Studio Enterprise 2019 for Mac ===
Version 8.9 (build 1651)
Installation UUID: aaddbdd9-5a26-4ee5-abd9-1a5540d751e7
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)
Package version: 612000122
=== Mono Framework MDK ===
Runtime:
Mono 6.12.0.122 (2020-02/c621c35ffa0) (64-bit)
Package version: 612000122
=== Roslyn (Language Service) ===
3.9.0-5.21112.8+f3ff04378c972d435826e6181de364b3c0db8d14
=== NuGet ===
Version: 5.8.0.6860
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/5.0.103/Sdks
SDK Versions:
5.0.103
5.0.102
5.0.101
5.0.100
3.1.406
3.1.405
3.1.404
3.1.403
3.1.402
3.1.401
3.1.302
3.1.301
3.1.300
3.1.202
3.1.200
3.1.102
3.1.100
3.0.101
2.1.700
2.1.4
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
5.0.3
5.0.2
5.0.1
5.0.0
3.1.12
3.1.11
3.1.10
3.1.9
3.1.8
3.1.7
3.1.6
3.1.5
3.1.4
3.1.2
3.1.0
3.0.1
2.1.23
2.1.22
2.1.21
2.1.20
2.1.19
2.1.18
2.1.17
2.1.16
2.1.15
2.1.14
2.1.11
2.0.5
=== .NET Core 3.1 SDK ===
SDK: 3.1.406
=== Xamarin.Profiler ===
Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Xamarin.Android ===
Version: 11.2.0.0 (Visual Studio Enterprise)
Commit: xamarin-android/d16-9/f908d16
Android SDK: /Users/hpadmin/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
7.1 (API level 25)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 30.0.2
Build Information:
Mono: 5e9cb6d
Java.Interop: xamarin/java.interop/[email protected]
ProGuard: Guardsquare/proguard/[email protected]
SQLite: xamarin/sqlite/[email protected]
Xamarin.Android Tools: xamarin/xamarin-android-tools/[email protected]
=== Microsoft OpenJDK for Mobile ===
Java SDK: /Users/hpadmin/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: 16.9.0.22
Hash: a391de2
Branch: remotes/origin/d16-9
Build date: 2021-02-18 03:14:56 UTC
=== Android Device Manager ===
Version: 16.9.0.17
Hash: fc2b3db
Branch: remotes/origin/d16-9
Build date: 2021-02-18 03:15:18 UTC
=== Apple Developer Tools ===
A valid Xcode installation was not found at the configured location: '/Applications/Xcode.app/Contents/Developer/'
=== Xamarin.Mac ===
Version: 7.8.2.5 (Visual Studio Enterprise)
Hash: 3836759d4
Branch: d16-9
Build date: 2021-02-10 17:56:43-0500
=== Xamarin.iOS ===
Version: 14.14.2.5 (Visual Studio Enterprise)
Hash: 3836759d4
Branch: d16-9
Build date: 2021-02-10 17:56:44-0500
=== Xamarin Designer ===
Version: 16.9.0.316
Hash: bd2705417
Branch: remotes/origin/d16-9
Build date: 2021-02-24 00:16:08 UTC
=== Build Information ===
Release ID: 809001651
Git revision: c05b1dec4362b5956d47624a437e900ffdc9aa0a
Build date: 2021-02-25 11:27:51-05
Build branch: release-8.9
Xamarin extensions: c05b1dec4362b5956d47624a437e900ffdc9aa0a
=== Operating System ===
Mac OS X 10.15.7
Darwin 19.6.0 Darwin Kernel Version 19.6.0
Tue Jan 12 22:13:05 PST 2021
root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64
@ColeX - so apparently, I'm not alone, https://developercommunity.visualstudio.com/t/vs-2019-mac-fails-to-find-xcode-12/1193691
This was the workaround from the thread I needed.
Answers
Set the path of
Xcode
in Location , it will search the sdk automatically.This is the screenshot on my side .
Xamarin forums are migrating to a new home on Microsoft Q&A!
We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
For more information, please refer to this sticky post.
Thanks @ColeX, but I tried that already yesterday. I probably should have mentioned that. First, after setting the path to Xcode.app I do see what you see, the "Restart Visual Studio" button just closes VS, but it doesn't relaunch. When I relaunch, the SDK location automatically reverted back to /Applications/Xcode.app/Contents/Developer/. In fact, if I set the path to Xcode.app and just hit "OK" to close Preferences. When I immediately reopen Preferences, again, the path has reverted back.
And again, this just started happening after I updated VS to 8.8 (build 1651) yesterday. Is that the version you have installed and tested?
Hey @ColeX , is anybody looking into this? I'm sort of dead in the water here. Thanks.
I Will Try to update vs for mac to latest and get you back .
Have you tried to run Xcode ? XCode may need to install some components when we open it at first time.
Yes, Xcode launches fine. Xcode was not updated yesterday.
Everything works fine after I update VS for mac to 8.9 .
The SDK path is correct and simulator runs fine .
I suggest you reinstall Xcode , then open Code , and reboot your mac .
As another datapoint, the option to open a storyboard in Xcode Interface Builder is also no longer available from within Visual Studio's context menu. Which I guess makes sense.
@ColeX when you set the location to where the Xcode.app is, did you select the "Restart Visual Studio button"? If so, did it really restart? And did the location path stick? I can explicitly set the path as well, and I see what you see. But, it doesn't stick. It always reverts back to /Applications/Xcode.app/Contents/Developer/.
I did nothing , the location path is always
/Applications/Xcode.app
by default .I suggest you delete Xcode form applications first ,and reinstall it , and then reboot mac .
If problem persists , consider creating a support request here : https://support.serviceshub.microsoft.com/supportforbusiness/create?sapId=211dd84f-3474-c3c5-79bf-66db630c92a6 .
Ok @ColeX . I also see that path on my 11.2 machine. But I didn't update Visual Studio on there. I updated on my 10.15 machine and it's there that has the problem. I'll try uninstalling Xcode and re-installing.
@ColeX - well I uninstalled and reinstalled Xcode and got the same version along with the same problem. It must be an 8.8 on 10.15 incompatibility because I have 8.8.10 on my 11.2.1 machine and it has no problem. And your 8.9 is not available when I check for updates on 10.15. How do I downgrade Visual Studio?
I started to create an incident a the support.serviceshub but I need some sort of contract or subscription. I have an MSDN subscription. Does that count?
I test on macOS Catalina 10.15.7 and the latest version of Vs for mac is 8.9.
Select older version (
8.8
) in Update Check menu and download ,reinstall .Ok @ColeX ...
but VS keeps changing it back.
Please advise. Where else would I be able to download older version of VS for Mac?
@ColeX - so apparently, I'm not alone, https://developercommunity.visualstudio.com/t/vs-2019-mac-fails-to-find-xcode-12/1193691
This was the workaround from the thread I needed.
Great ! If problem has been solved could you mark the answer to finish this thread ?
The workaround DID solve that problem, but I'm still having build issues with 8.8 and 8.9 on 10.15.7 which may or may not be related to this, and are not issues on my iMac running 11.2.1. But since this issue is pretty specific, I will mark as answered and start another thread, if my current issues persist.
@ColeX - where can I get a Visual Studio for Mac installer? One for a specific older version? Or can you provide me one for the version before 8.8? Thanks?
UPDATE:
The suggested answer did help me! The key was adding the trailing slash to the end of /Applications/Xcode.app/
Wow! Thanks to the person who discovered this, total shame on M$ and the Xamarin team for such a bogus bug! Such a shame! Many developer hours were wasted unnecesserily.
ORIGINAL TEST:
The suggested answer did not help me
1) Problem in VS:

2)

3)

4) After restart, the same problem appears again:

5) Preferences are back again:

You can try with this, It works for me. No need to reinstall Visual Studio or Xcode and no need to restart.
Let's assume the location of xcode is at /Applications/Xcode.app (default)
Open Terminal, and type:
sudo xcode-select --switch /Applications/Xcode.app