jmayor
jmayor

Reputation: 2795

Visual Studio won't compile Xamarin IOS Could not locate SDK bin directory

I'm trying to compile a Xamarin IOS solution in Visual Studio from Windows PC but I get the following error 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(624,3): error : Could not locate SDK bin directory

I have already checked online for the default paths for xCode and it's all ok. I updated xCode on the mac to version 10.0

This is the lines on the IOS.Common.targets that are failing

<DetectSdkLocations
        SessionId="$(BuildSessionId)"
        Condition="'$(IsMacEnabled)' == 'true'"
        SdkVersion="$(MtouchSdkVersion)"
        TargetFrameworkIdentifier="$(TargetFrameworkIdentifier)"
        TargetArchitectures="$(TargetArchitectures)"
        >

        <Output TaskParameter="SdkVersion" PropertyName="MtouchSdkVersion" />
        <Output TaskParameter="SdkRoot" PropertyName="_SdkRoot" />
        <Output TaskParameter="SdkBinPath" PropertyName="_SdkBinPath" />
        <Output TaskParameter="SdkDevPath" PropertyName="_SdkDevPath" />
        <Output TaskParameter="SdkUsrPath" PropertyName="_SdkUsrPath" />
        <Output TaskParameter="SdkPlatform" PropertyName="_SdkPlatform" />
        <Output TaskParameter="SdkIsSimulator" PropertyName="_SdkIsSimulator" />
        <Output TaskParameter="IsXcode8" PropertyName="_IsXcode8" />
    </DetectSdkLocations>

Upvotes: 7

Views: 6066

Answers (4)

Dusty
Dusty

Reputation: 3971

Update to Visual Studio >= 15.8.5

Update: As of September 20, 2018, Visual Studio version 15.8.5 is released, which contains official Xamarin support for XCode 10.

For older versions of VS: Rollback XCode 10

Edit: A colleague reported that, for him, launching XCode 10 and waiting for it to finish its upgrade configuration allowed him to build Xamarin iOS projects normally. I tried that myself before rollback and didn't have luck, but perhaps YMMV. Original answer about rolling back to 9.4.1 below.

I tried a lot of different approaches to this. Xamarin builds started failing for me immediately after I accepted the XCode 10 update. After trying a few other things, the thing that worked was just rolling back XCode to 9.4.1.

You can rollback XCode by deleting the application from your Applications and then downloading 9.4.1 from the Apple developer site, as shown in this answer.

Upvotes: 5

jmayor
jmayor

Reputation: 2795

when I looked I had installed Visual Studio 2017 v15.7.2 so downloading the latest 15.8.4 from https://learn.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes Solved my problem I'm back running IOS apps being compiled at my Windows PC with Visual Studio and Xcode 10 is installed on the Mac.
Thanks to LucasZ for the link provided, I tried installing that Alpha but when trying so it warned me I had not the latest Visual Studio and that's how I got to install that v15.8.4

Upvotes: 3

Lucas Zhang
Lucas Zhang

Reputation: 18861

Because the version of VS for windows is still 15.8.x.So you can Installing IDE compatibility for Visual Studio 2017 version 15.8. Refer to the link here

In addition, you can download the VS for window 15.9.0 preview from here .And the stable version will be released soon.

Upvotes: 2

BReeves
BReeves

Reputation: 33

To elaborate on Dusty's answer, I had to let XCode 10 do its install thing, and also update VS Mac. The Stable channel worked for me, but I also noticed that there's a new, "XCode 10 Preview" channel in the VS Mac update window. I'm not sure what the difference is. I was able to build after fully updating on the Stable channel, but my plan if that failed was to try the XCode 10 Preview channel.

Upvotes: 1

Related Questions