xcode11beta版SwiftUI的画布无法展示

15 篇文章 0 订阅

对SwiftUI怀有极大的好奇心,先是升级了Xcode11beta版,就迫不及待的创建了SwiftUI的工程,本以为会一切顺利,结果坑还是不有的,现总结如下:

1、创建SwiftUI后发现画布不展示(画布是swiftUI新的功能,即可以事实查看界面),ps:我当前的系统是莫哈维Mojave10.14.5。查看苹果官方文档后,发现SwiftUI需要将系统升级到10.15,而现在只有beta版的,ok,升级为beta10.15版系统

2、升级完系统,这下画布出现了,但是画布编译报错 failed to build ContentView.swift,点击右侧的Diagnostics进行诊断,结果如下:

invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

----------------------------------------

failedToCodeSign: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

/Users/yangyangzi/Library/Developer/Xcode/DerivedData/CreatingAndCombiningViews-ftgpsvdswgizgqgyfzdaoirbhbey/Build/Intermediates.noindex/Previews/Landmarks/Intermediates.noindex/CreatingAndCombiningViews.build/Debug-iphonesimulator/Landmarks.build/Objects-normal/x86_64/ContentView.2.preview-thunk.dylib: the codesign_allocate helper tool cannot be found or used

解决方法:安装xcode命令行工具:command line tools

安装过程如下:

2.1》打开终端,输入如下命令:xcode-select --install 按回车

2.2》根据弹框提示选择 安装-》同意许可  即可安装

2.3》安装完成后在终端在此执行命令xode-select --install,出现以下情况,则说明安装成功

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

yangyangzideMacBook-Air:~ yangyangzi$ sudo xcodebuild -license

安装好xcode命令行工具,再点击画布的resume,这下画布就能正常展示了

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值