xcode Visual Studio 不会编译 Xamarin IOS 找不到 SDK bin 目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52398460/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio won't compile Xamarin IOS Could not locate SDK bin directory
提问by jmayor
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
我正在尝试从 Windows PC 在 Visual Studio 中编译 Xamarin IOS 解决方案,但出现以下错误 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS .Common.targets(624,3): 错误:找不到 SDK bin 目录
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
我已经在线检查了 xCode 的默认路径,一切正常。我将 mac 上的 xCode 更新到了 10.0 版
This is the lines on the IOS.Common.targets that are failing
这是失败的 IOS.Common.targets 行
<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>
采纳答案by jmayor
when I looked I had installed Visual Studio 2017 v15.7.2 so downloading the latest 15.8.4 from https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotesSolved 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
当我查看时,我已经安装了 Visual Studio 2017 v15.7.2,因此从https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes下载最新的 15.8.4
解决了我的问题,我重新运行 IOS在我的 Windows PC 上使用 Visual Studio 和 Xcode 10 编译的应用程序安装在 Mac 上。
感谢 LucasZ 提供的链接,我尝试安装该 Alpha,但在尝试时它警告我没有最新的 Visual Studio,这就是我安装 v15.8.4 的方式
回答by Dusty
Update to Visual Studio >= 15.8.5
更新到 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.
更新:截至 2018 年 9 月 20 日,发布了Visual Studio版本 15.8.5,其中包含对 XCode 10 的官方 Xamarin 支持。
For older versions of VS: Rollback XCode 10
对于旧版本的 VS:回滚 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.
编辑:一位同事报告说,对他来说,启动 XCode 10 并等待它完成升级配置使他能够正常构建 Xamarin iOS 项目。我在回滚之前自己尝试过并且没有运气,但也许是 YMMV。关于回滚到下面的 9.4.1 的原始答案。
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.
我为此尝试了很多不同的方法。在我接受 XCode 10 更新后,Xamarin 构建立即开始失败。在尝试了其他一些事情之后,有效的方法就是将 XCode 回滚到 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.
您可以通过从您的应用程序中删除应用程序,然后从 Apple 开发人员站点下载 9.4.1 来回滚 XCode ,如此答案所示。
回答by Lucas Zhang - MSFT
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
因为VS for windows的版本还是15.8.x.所以可以安装兼容Visual Studio 2017 15.8版的IDE。请参阅此处的链接
In addition, you can download the VS for window 15.9.0 preview from here.And the stable version will be released soon.
另外,您可以从这里下载VS for window 15.9.0 预览版。稳定版即将发布。
回答by BReeves
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.
为了详细说明 Dusty 的答案,我不得不让 XCode 10 进行安装,并更新 VS Mac。Stable 频道对我有用,但我也注意到 VS Mac 更新窗口中有一个新的“XCode 10 预览”频道。我不确定有什么区别。在稳定频道上完全更新后,我能够进行构建,但如果失败,我的计划是尝试 XCode 10 预览频道。