无法使用Xcode 8.0和Swift 3构建子项目

时间:2016-10-27 04:32:05

标签: xcode xcode8 sqlite.swift

我正在运行Xcode 8.0构建版本8S174q和Apple Swift 3.0版(swiftlang-800.0.34.6 clang-800.0.33)。

Pauls-Mac-mini:~ paul$ xcrun xcodebuild -version
Xcode 8.0
Build version 8S174q
Pauls-Mac-mini:~ paul$ xcrun swift -version
Apple Swift version 3.0 (swiftlang-800.0.34.6 clang-800.0.33)
Target: x86_64-apple-macosx10.9
Pauls-Mac-mini:~ paul$ xcrun --find swift
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift

https://github.com/stephencelis/SQLite.swift我安装了0.11.0版(注意它是用Swift 3编写的)。我已经尝试了该网页上的三种安装方法,经过一天的捣乱仍无法获得sqlite.swift进行编译。通过Xcode报告导航器(CMD-8),我看到了数百个编译错误,其中一些是我在下面粘贴的。

/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift:69:9: error: expected declaration
        fileprivate init(rawValue:Int32) {
        ^
/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift:58:17: note: in declaration of 'Operation'
    public enum Operation {
                ^
/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift:69:20: error: consecutive declarations on a line must be separated by ';'
        fileprivate init(rawValue:Int32) {
                   ^

我最初怀疑swift 3.0编译器没有被使用,但是从查看编译命令(下面)看起来似乎不是这样。

我尝试了3种方法来安装SQLite.swift - 使用Carthage,cocoapods并安装SQLite.swift作为Xcode子项目。我无法构建SQlite.swift。

请帮忙!我是iOS开发,Xcode和工具的新手,所以我很难过。下面我添加了一些更详细的信息,例如生成错误的编译命令。您能否提出一个可能的解决方案,甚至可以尝试建立这个子项目?

CompileSwift normal x86_64 /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/CoreFunctions.swift
    cd /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/CoreFunctions.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Extensions/RTree.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Blob.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Foundation.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Expression.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Helpers.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Collation.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Setter.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/CustomFunctions.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Extensions/FTS4.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Value.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Operators.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Schema.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Query.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Statement.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/AggregateFunctions.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Extensions/FTS5.swift -target x86_64-apple-ios10.0 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk -I /Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Products/Debug-iphonesimulator -I /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/CocoaPods/iphonesimulator-10.0 -F /Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Products/Debug-iphonesimulator -application-extension -enable-testing -g -import-underlying-module -module-cache-path /Users/paul/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/swift-overrides.hmap" -Xcc -iquote -Xcc "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-generated-files.hmap" -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-own-target-headers.hmap" -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-all-non-framework-target-headers.hmap" -Xcc -ivfsoverlay -Xcc /Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/all-product-headers.yaml -Xcc -iquote -Xcc "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-project-headers.hmap" -Xcc -I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Products/Debug-iphonesimulator/include -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/DerivedSources/x86_64" -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/DerivedSources" -Xcc -DDEBUG=1 -Xcc -ivfsoverlay -Xcc "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/unextended-module-overlay.yaml" -Xcc -working-directory/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift -emit-module-doc-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions~partial.swiftdoc" -Onone -module-name SQLite -emit-module-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions~partial.swiftmodule" -serialize-diagnostics-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.dia" -emit-dependencies-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.d" -emit-reference-dependencies-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.swiftdeps" -o "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.o"

1 个答案:

答案 0 :(得分:1)

问题是由于使用的swift版本不支持https://github.com/stephencelis/SQLite.swift版本0.11.0中的某些新的快速语言功能(例如fileprivate访问级别修饰符)。很难将Xcode beta版本与swift相关联 版本(在这种情况下为swiftlang-800.0.34.6 clang-800.0.33)到swift语言发行说明(https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/RevisionHistory.html)。

我升级到使用Swift 3.0.1的Xcode 8.1,现在看不到构建问题。现在Xcode不再是测试版,我希望在xcode版本之间交叉引用,快速语言代码和快速发行说明将更容易。

相关问题