我尝试在 Apple 提供的 Swift 中构建示例代码
A Productivity App Built in Swift
但是当我运行它时,它会弹出这样的错误:
"Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-stdlib-tool failed with exit code 1"
有人知道怎么解决吗?
最佳答案
实际原因是因为xcode不能代码签名:
iPhone Developer: no identity found
**error: Couldn't codesign /Users/zhaoj5/Library/Developer/Xcode/DerivedData/Lister-hehrkmcyuflnfucnsqcofjotmglo/Build/Products/Debug-iphonesimulator/com.example.apple-samplecode.Lister.ListerToday.appex/Frameworks/libswift_stdlib_core.dylib: codesign failed with exit code 1**
Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-stdlib-tool failed with exit code 1
这是因为您不是注册的 Apple Developer。如果你去项目 ->一般,你会看到有一个警告:
“此产品类型必须使用配置文件构建,但是,未指定签名身份或配置文件,Xcode 可以通过从成员(member)中心下载新的配置文件来解决此问题。”
有一个“修复问题”按钮,您可以在成为注册开发者后输入您的帐户信息。
关于ios - 用 Swift 构建的生产力应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24112954/