2016-07-01 1 views
1

나는이 프로젝트에 cocoapod를 설치하고 문제는 컴파일러는 내가 스위프트이 사용하고 있다고 생각입니다 스위프트 3.스위프트 컴파일러는 혼란 버전 2 및 3

그것을 통해 변경하는 데에 컨버터를 실행하고있다 적절한 Swift 3 구문 (129 개 오류)에 오류가 발생했습니다. 예 :

internal enum Error: ErrorProtocol { 
    case noCentralManagerSet 
    case busy 
    case interrupted 
} 

던져 넣기 use of undeclared type 'ErrorProtocol'.

enter image description here

잘못 무엇입니까?

내가 작성한 Swift 3 코드는 이 아니고 던지고있는 컴파일러 오류입니다.

2016-07-01 14:16:05.850 xcodebuild[30824:2848916] [MT] PluginLoading: Required plug-in compatibility UUID 1637F4D5-0B27-416B-A78D-498965D64877 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WebDevSupport.xcplugin' not present in DVTPlugInCompatibilityUUIDs 
2016-07-01 14:16:05.864 xcodebuild[30824:2848916] [MT] PluginLoading: Required plug-in compatibility UUID 1637F4D5-0B27-416B-A78D-498965D64877 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WebDevelopment.xcplugin' not present in DVTPlugInCompatibilityUUIDs 
2016-07-01 14:16:05.911 xcodebuild[30824:2848916] [MT] PluginLoading: Required plug-in compatibility UUID 1637F4D5-0B27-416B-A78D-498965D64877 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/WakaTime.xcplugin' not present in DVTPlugInCompatibilityUUIDs 
2016-07-01 14:16:05.944 xcodebuild[30824:2848916] [MT] PluginLoading: Required plug-in compatibility UUID 1637F4D5-0B27-416B-A78D-498965D64877 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Rayrolling.xcplugin' not present in DVTPlugInCompatibilityUUIDs 
2016-07-01 14:16:05.967 xcodebuild[30824:2848916] [MT] PluginLoading: Required plug-in compatibility UUID 1637F4D5-0B27-416B-A78D-498965D64877 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CocoaPods.xcplugin' not present in DVTPlugInCompatibilityUUIDs 
2016-07-01 14:16:05.997 xcodebuild[30824:2848916] [MT] PluginLoading: Required plug-in compatibility UUID 1637F4D5-0B27-416B-A78D-498965D64877 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs 
OS X SDKs: 
    OS X 10.12      -sdk macosx10.12 

iOS SDKs: 
    iOS 10.0      -sdk iphoneos10.0 

iOS Simulator SDKs: 
    Simulator - iOS 10.0   -sdk iphonesimulator10.0 

tvOS SDKs: 
    tvOS 10.0      -sdk appletvos10.0 

tvOS Simulator SDKs: 
    Simulator - tvOS 10.0   -sdk appletvsimulator10.0 

watchOS SDKs: 
    watchOS 3.0      -sdk watchos3.0 

watchOS Simulator SDKs: 
    Simulator - watchOS 3.0   -sdk watchsimulator3.0 

답변

3

당신은 모든 대상에 대해 스위프트 버전을 설정할 수 있습니다

Legacy Swift Language Version

프로젝트는 아마도 Yes로 설정되었다.

SDK는 컴파일 프로세스에 포함되지 않습니다.

1

나는 문제가 무엇인지 알고 있다고 생각 : 여기

xcodebuild -showsdks의 출력입니다. 모든 파일을 Swift2.0에서 Swift3으로 직접 변환했습니다. 그것은 그렇게 작동하지 않을 것이다. 포드를 삭제하고 Swift3 브랜치를 this (현재 사용하고 있다고 생각합니다) 복제하고 해당 소스 디렉토리를 현재 프로젝트에 복사하는 것이 좋습니다. 어떤 버전의 레포가 사용 가능한지 알려지지 않으므로 swift-3을 사용할 수 있습니다. 문제를 해결해야합니다. :)

+0

'xcodebuild -showsdks '가 내게 말하는 명령은 무엇입니까? 그리고 저는 Xcode 8 만 실행하고 있습니다. –

+0

나는 당신에게 말했습니다. Xcode가 현재 사용중인 SDK 목록을 보여줍니다. Xcode 7이 전혀 없습니까? – Dershowitz123

+0

하드 다이빙 공간이 부족하기 때문에 Xcode 7을 삭제했습니다. 질문에 명령의 결과를 추가했습니다. –

0

두 가지를 통해 이러한 사례를 관리 할 수 ​​있습니다.

Xcode가 Xcode 7에서 프로젝트 A를 연 다음 Xcode 8을 열어 새로운 무언가를 시작하면 닫히지 않은 이전 프로젝트가 자동으로 열리기 때문에 Xcode 8도 같은 프로젝트 A를 엽니 다. 따라서 실제로 프로젝트 A를 닫아야합니다. Xcode 8을 선택하면 프로젝트 A가 열려 있기 때문에 많은 오류가 발생하고 Xcode 7에서 작업하고 있다고 생각할 수 있습니다. 물론 스위프트 3.

우리는 버전 컨트롤을 가지고 있지만 단지 -이 시점에서 프로젝트 A는 하나의`프로젝트 이름이 있음을 또한

내가 내 프로젝트 폴더의 이름을 엑스 코드 (7)와 엑스 코드 (8)에서 열린 projectName - Swift 2는 다음을 복제하고 이름입니다 안전을 기하기 위해 Xcode의 두 버전에서 같은 프로젝트를 열면 미쳐 버릴 수 있기 때문에 Swift 2/3에 대해 두 개의 별도 폴더가있는 것이 좋습니다.

포드 설치를 위해 별도의 디렉토리를 사용하도록 터미널에 지시해야하므로 중첩되지 않으므로 안전합니다.