Xcode 6.0.1 명령 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc가 종료 코드 1과 함께 실패했습니다.
아카이브에서이 오류가 발생합니다.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc 명령이 종료 코드 1로 실패했습니다.
그것을 해결하는 방법?
스크린 샷을 참조하십시오.
이 문제는 Swift 최적화 수준 이 릴리스에 대해 없음 으로 설정되지 않은 경우 발생합니다 . 값을 없음으로 설정하면 문제가 사라집니다.
- 프로젝트를 열고 프로젝트 루트 디렉토리를 클릭하십시오.
- 빌드 설정 탭을 클릭하십시오.
- Swift Compiler-Code Generation을 검색 하고 Optimization Level에서 Release 가 None 으로 설정되어 있는지 확인 합니다.
편집하다
Xcode 6.1로 업그레이드 한 후이 지침으로 인해 보관할 때 다른 문제가 발생했습니다 (디버그 / 장치 용 빌드가 정상적으로 작동 함). 최적화를 가장 빠름으로 설정하면 다시 아카이브 할 수있었습니다. Swift 컴파일에는 여전히 명백한 문제가 있습니다 (특히 보관).
Xcode 6.1에서 작동하는 6.0.1 Swift 프로젝트를 보관할 수 없음 / 분할 오류 : 11
편집 이 답변을 읽을 때까지 빌드 설정 탭에 자금을 지원할 수 없었습니다.
이것은 정확히 동일한 파일이 두 개있을 때 발생했으며 파일이 누락되었을 때 삭제 한 것을 몰랐습니다. 오류 메시지를 클릭하면 오류 바로 위에있는 파일 중 하나 이상이 있거나 누락 된 파일이 표시됩니다.
탐색에서 제품을 클릭하고 "청소"버튼을 선택할 수 있습니다. 프로젝트의 모든 컴파일 오류를 정리합니다. 그런 다음 최신 오류를 디버그 할 수 있습니다.
삭제 된 파일 참조는 빌드 단계에 유지되므로이 오류가 발생합니다. 거기에서 참조도 제거하십시오.
프로젝트> 대상> 빌드 단계
이 섹션에서 삭제 된 파일이 빨간색으로 표시됩니다. 이 파일을 제거하면 오류가 해결됩니다.
하나의 해결책이 있는지 잘 모르겠습니다. 마지막 git 커밋의 차이점을 확인하고 변경 사항에 대해 주석을다는 것이 좋습니다.
제 경우에는 내 코드는
let anArray = ResultDict["ResultSet"] as [[NSDictionary : AnyObject]]
for aDict : NSDictionary in anArray {
let anObject = ObjectType(ObjectDict: aDict)
objectList.addObject(aDict)
}
줄에 경고가 없으며 동일한 종료 1 컴파일 오류가 발생하고 컴파일 된 아래로 변경했습니다.
let anArray = ResultDict["ResultSet"] as [[NSDictionary : AnyObject]]
for aDict in anArray {
let anObject = ObjectType(ObjectDict: aDict)
objectList.addObject(aDict)
}
이게 정말 답인지 모르겠지만 ...
나는 같은 문제 가 있었다 . 앱을 빌드 / 실행할 때 작동했지만 "... swiftc가 종료 코드 1로 실패했습니다"로 실패했으며 다른 유용한 메시지는 전혀 없습니다. 운 좋게도 Nomad 's를 사용 하여 앱을 빌드하려고하면 다음과 같은 결과를 ipa build
얻었습니다.
The following build commands failed:
CompileSwift normal arm64 /path/to/erroneous/TableViewController.swift
그래서 저는 그 파일의 섹션을 주석 처리하기 시작했고 문제를 튜플 할당까지 추적했습니다.
// MARK: - Table Data
private var tableData: [(sectionName: String, item:ListItem)] = []
private func refreshTableData() {
// let labor = ("Labor", laborListItem) // DOESN'T ARCHIVE
let labor = (sectionName: "Labor", item: laborListItem) // ARCHIVES
tableData = [labor]
tableView.reloadData()
}
그래서 분명히 컴파일러는 이름이 지정된 튜플의 요소를 원했습니다 (유형에 의해 정의 됨 tableData
) .. 그러나 보관 용으로 만? 멍청한 것은 다른 뷰 컨트롤러에서 이와 동일한 패턴을 사용하고 컴파일러가 그 패턴으로 괜찮아 보인다는 것입니다.
레코드의 Code Generation -> Optimization Level
경우 디버그 및 릴리스에 대해 없음으로 설정되었습니다.
이것이 누군가를 돕기를 바랍니다! 이것을 알아내는 데 몇 시간이 걸렸습니다.
함수 호출 끝에 괄호를 넣지 않았을 때 발생했습니다.
let var = self.getNextPrimeNumber
해결 방법 :
let var = self.getNextPrimeNumber()
제 경우에는 프로젝트 디렉토리에서 동일한 이름을 사용하는 중복 파일로 인해 발생했습니다. 그들을 제거하자마자 오류가 사라졌습니다.
빠른 파일에서 정적 인라인 함수를 사용할 때 이런 일이 발생했습니다.
함수는 다음과 같습니다.
static inline void openURLInSafari(NSString * _Nonnull urlString) {
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:urlString]];}
나는 방금 똑같은 일이 일어났습니다. 비어 있어도 오류를 일으킨 하나의 파일로 원인을 찾아 냈습니다. 파일을 조사한 결과 잘못된 문자 세트가 있음을 발견했습니다. UTF-8로 설정하면 오류가 사라졌습니다. 잘못된 문자 세트로 디코딩했다고 생각합니다.
이것으로부터 나는 오류가 단순히 컴파일러가 준비되지 않은 일이 발생했음을 나타냅니다. 대부분의 사람들에게 도움이되지는 않지만, 캐릭터 세트를 확인하는 데 도움이 될 수 있습니다.
추적하는 데 몇 시간이 걸리는이 오류로 이어질 수있는 또 하나의 경우 : 항상 nil을 반환하는 실패 가능한 초기화 프로그램입니다.
다음과 같은 초기화 프로그램이 있습니다.
init?(object: MyObject) {
if object.importantProperty {
// initialize
}
return nil
}
내가 의미했던 것은 :
init?(object: MyObject) {
if object.importantProperty {
// initialize
}
else {
return nil
}
}
이니셜 라이저를 수정하면 오류가 사라졌습니다.
사용하는 경우 Core Data
: Xcode의 도움으로 하위 클래스를
만든 Core Data 엔티티가 NSManagedObject
있습니다. 또한 엔터티는 코드를 자동으로 생성하도록 구성되었으므로 (스크린 샷 참조) 기본적으로 런타임 동안 2 개의 클래스가 존재했습니다. 옵션을 수동 / 없음으로 전환하면 생성되지 않습니다.
This error occurred for me after I noticed that a few of my .swift files were inexplicably in the wrong directory -- one level above my Xcode project directory. When I noticed this, I moved them into the main project directory and cleaned the project, thinking everything would be fine. However, upon building the project I got the above-mentioned "failed with exit code 1" error. Just above the error message it listed the files I had just moved, indicating that it couldn't find them in the directory where they used to be. In addition to the error message, the files I moved were now showing up as red in the file navigation pane.
For each of the files in question what I did to resolve this was: - Select the file from the list of files in the Xcode file navigation pane, - Click on the little page icon in the rightmost pane of Xcode, which opens a file attributes pane, - Click on the little folder icon underneath where it says "Location" in the file attributes pane, - Choose the new location for the file, - RESTART Xcode for the above changes to really do anything.
this error comes from missing files so the compiler couldn't find the files and keep alerting. Follow these steps to rebuild your app:
- Look up for the red and invisible files within workspace
- Remove their reference
- Re-add files
- Re-compile
I experienced this error after performing a git merge. I solved new Xcode warnings and the project can be compiled.
Xcode 7.2.1 is used in my case.
In my way the error was due to UIDevice.currentDevice()
in ((UIDevice.currentDevice().systemVersion as NSString).floatValue >= 8.0)
After commenting this all starts work fine.
XCode 7.2
in my case , at your project target Build Setttings, in Other Swift Flags,jsut delete the String "-serialize-debuggin-options" enter image description here
I had a resolution very similar to RyanM, where with an excess of hubris I tried to assign a variable to the default value of an inner function:
Fails to compile (though does not crash SourceKit):
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
func itemCell(_ indexPath: IndexPath = indexPath) -> UITableViewCell {//...}
Succeeds:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
func itemCell(_ indexPath: IndexPath) -> UITableViewCell {//...}
One possible reason that this can happen is perhaps because you have deleted a file but not removed references to it. This will mess up the pbxproj file. I would check to see if that is the case.
check "Development Pods" Folder all listed Frameworks path.
In my case swift development snapshot was selected instead of xcode 9.2. here are the steps and image.
- keep xcode on screen and click on xcode top menu bar.
- Than go to toolchains option and check on xcode 9.2. thats it.
Happy Coding!!!
So, I had the above and narrowed it down to a TFS issue with locking the file but only when I pasted or did any other edits besides small copies or manual typing. I noticed the original file would compile, but my edits wouldn't, even though they were syntactic OK. Also related is unable to save document: xcode The document "..." could not be saved
The fix for both was:
- Duplicate working version.
- Paste fully-merged new code into duplicate.
- Copy and paste old file over new one. (I personally just renamed the old one to something else, then pasted duplicate and renamed it, too. Guessing both work since I pasted directly earlier for reverts during tests to see).
Voila. Lazy way to bypass merge-locking issue. Apparently full file-pastes are just fine, while edits aren't. Shared since the other answers don't seem to be as lazy as this. ;) Note: I am suspecting a non-UTF-8 character made its way somewhere, but pastes worked in older versions so I don't know where, or if relevant.
In my case, the error was the result of missing files that were generated by Xcode. I tried the regular clean Opt+Shift+K and it didn't clean up all the errors. I found a post on the Apple Developer site that recomended going to the Product Menu in Xcode, holding down the opt key, and selecting Clean Build Folder. This appears to be a more comprehensive build as it pops up a modal dialog for you to confirm.
Just go to the "project setting" and click on the "build phaces" after that you will find targets in that u have to delete the test file like my project name "WER" so its showing like this WER&TEST so just delete that and clean ur project and run .........
'Program Tip' 카테고리의 다른 글
Git은 추적 된 파일의 일부에 대한 로컬 변경 사항을 무시합니다. (0) | 2020.11.16 |
---|---|
Swift의 FileManager를 사용하여 폴더 및 하위 폴더의 파일을 반복합니다. (0) | 2020.11.16 |
Angular에서 사용자 지정 테마 팔레트를 어떻게 사용할 수 있습니까? (0) | 2020.11.16 |
bash의 백틱에 해당하는 cmd / powershell은 무엇입니까? (0) | 2020.11.16 |
Subversion에서 삭제 된 분기를 복원해야합니다. (0) | 2020.11.16 |