development

Xcode 10 오류 : 여러 명령 생성

big-blog 2020. 2. 12. 23:39
반응형

Xcode 10 오류 : 여러 명령 생성


error: Multiple commands produce '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist':
1) Target 'OptimalLive' has copy command from '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Info.plist' to '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist'
2) Target 'OptimalLive' has copy command from '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Server/Masonry/Info.plist' to '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist'
3) Target 'OptimalLive' has process command with input '/Users/uesr/Desktop/workSpace/SEALIVE/SeaLive1.1/OptimalLive/Info.plist'

Xcode9에서 코드를 실행하면 작동하지만 Xcode10에서 오류가 발생합니다.


응용 프로그램 내의 여러 Plist 또는 다른 파일로 인해 문제가 발생했을 수 있습니다.

솔루션-> 대상 열기-> 빌드 단계> 번들 자원 복사info.plist거기에서 제거하십시오 .

여기에 이미지 설명을 입력하십시오

참고 : 시계 앱도 개발 한 경우 시계 및 시계 확장에서 plist를 제거해야합니다.


이 빌드 오류에 대한 해결책을 찾았습니다. 다른 사람이 Xcode 10 빌드 시스템과 동일한 문제를 겪고 있다면 다음 단계에 따라 문제를 해결하십시오.

  1. Xcode에서 파일-> 프로젝트 / 작업 공간 설정으로 이동하십시오.
  2. 빌드 시스템을 레거시 빌드 시스템으로 변경하십시오.

여기에 이미지 설명을 입력하십시오 새로운 Xcode 10의 빌드 문제를 해결합니다.

새로운 빌드 시스템으로 작업하려면 이 Apple Xcode 도움말 페이지에서 문제 해결 도움말 찾을 수 있습니다 .

도움이 되었기를 바랍니다!


Xcode-> 파일-> 작업 공간 설정으로 이동하십시오. 당신은 하나의 팝업을 찾을 수 있습니다.

여기에 이미지 설명을 입력하십시오

빌드 시스템 태그에서 " 레거시 빌드 시스템 "을 선택하십시오 . " 완료 "를 누르 십시오

참고 :- " cmd + shift + alt + k "및 " 파생 데이터 "를 사용 하여 프로젝트를 지우십시오.

매력을 발휘할 프로젝트를 빌드하십시오 :)


이것도 시도하십시오. Xcode-> 파일-> 프로젝트 설정-> 빌드 시스템-> 레거시 빌드 시스템.


Ditto동일한 이름의 여러 인스턴스를 작성 하는 명령 에서이 정보를 얻는 경우 ()가 아닌 경우을 'copy files' build phase변경해야 할 수도 있습니다 Product Module Name.

  1. 대상 Xcode가 불평하는 대상을 클릭하십시오.
  2. 클릭 Build Settings
  3. 검색 Product Module Name
  4. 이름을 고유 한 이름으로 변경

앱에는 감시 대상과 알림 대상이 있으므로 Extension모듈 이름 끝에 같은 것을 넣습니다 .

이 솔루션을 원래 여기에서 찾았습니다 : https://forums.developer.apple.com/thread/103913


Core Data를 실험하고있었습니다. 간단한 체크리스트 프로그램을위한 데이터 모델을 구축하고 NSManagedObjects를 생성했습니다. 프로젝트를 컴파일 할 때 다음 오류가 발생했습니다.

error: Multiple commands produce '/Users/myUSerName/Library/Developer/Xcode/DerivedData/myCoreDateExperiment-gzbslaqdwglkzxemijpdqmizgyzc/Build/Intermediates.noindex/ myCoreDateExperiment /Debug-iphonesimulator/ myCoreDateExperiment.build/Objects-normal/x86_64/CheckListItem+CoreDataProperties.o':
1) Target ' myCoreDateExperiment ' (project ' myCoreDateExperiment ') has compile command for Swift source files
2) Target ' myCoreDateExperiment ' (project ' myCoreDateExperiment ') has compile command for Swift source files

문제는 데이터 모델 (필자의 경우 CheckList.xcdatamodeld)이 "컴파일 소스"목록에 있다는 것입니다. 목록에서 프로젝트를 제거하면 프로젝트가 깨끗하게 컴파일되었습니다.

  1. 프로젝트 탐색기를 열고 프로젝트를 선택하십시오 (맨 처음에 가장 먼저 입력)
  2. "프로젝트 및 대상"창의 대상에서 빌드 대상을 선택하십시오.
  3. 상단 근처의 빌드 단계 옵션을 선택하십시오.
  4. "컴파일 소스"항목을 펼치고 데이터 모델 이름을 찾으십시오. "xcdatamodeld"를 찾는 데 문제가 있으면 검색하십시오.
  5. 컴파일리스트에서 모델 삭제
  6. 데이터 모델이 "Copy Bundle Resources"목록에 포함되어 있는지 확인하십시오. 누락 된 경우 추가하십시오.

빌드 로그를 확인하는 동안 경고가 나타났습니다.

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
warning: The Copy Bundle Resources build phase contains this target's Info.plist file '/Users/<redacted>/Repositories/Whitesmith/optimize-ios/Carthage/Checkouts/WSStatusBarNotification/Miscellaneous/Info.plist'. (in target 'JDStatusBarNotification')

따라서 귀하의 경우라면 목표로 가십시오.

  1. 빌드 단계
  2. 번들 자원 복사
  3. 를 제거하십시오 info.plist.

CocoaPods를 사용하는 경우 포드를 분리 한 후 다시 설치하십시오. 그것은 나를 위해 작동합니다.

pod deintegrate

pod install


이것을 시도하십시오 :

Xcode에서 파일-> 프로젝트 / 작업 공간 설정으로 이동하십시오.

빌드 시스템을 레거시 빌드 시스템으로 변경하십시오.


오류 메시지가 핵심 데이터 파일을 참조하는 경우이 답변을 읽으십시오

개요 : 자동 생성 및 수동 생성 Core Data 관리 객체 클래스 파일이있을 수 있습니다.

이 답변은 오류의 첫 번째 줄이 Foo + CoreDataProperties.o 또는 Foo + CoreDataClass.o 파일을 참조하는 경우에 적용됩니다 . 예:

error: Multiple commands produce '/Users/me/Library/Developer/Xcode/DerivedData/MyApp-uebslaqdwgldkjemijpdqmizgyzc/Build/Intermediates.noindex/ MyApp /Debug-iphonesimulator/ MyApp.build/Objects-normal/x86_64/Foo+CoreDataProperties.o':

1) Target ' MyApp ' (project ' MyApp ') has compile command for Swift source files

2) Target ' MyApp ' (project ' MyApp ') has compile command for Swift source files

근본 원인은 Build Transcript Compile Swift Source Files 섹션을 확장하여 확인할 수 있습니다 . 예를 들면 다음과 같습니다.

<unknown>:0: error: filename "Address+CoreDataClass.swift" used twice: '/Users/myUserName/Projects/Jnky/Foo+CoreDataProperties' and '/Users/jk/myUserName/Developer/Xcode/DerivedData/MyApp-uebslaqdwgldkjemijpdqmizgyzc/Build/Intermediates.noindex/MyApp.build/Debug/MyApp.build/DerivedSources/CoreDataGenerated/Jnky/Foo+CoreDataProperties.swift'

언급 한 첫 번째 파일은 프로젝트 탐색기에 소스 파일이 있으며, 누군가 프로젝트 네비게이터에서 데이터 모델을 선택하고 편집기 > 관리 오브젝트 서브 클래스 작성 메뉴를 클릭하여 생성 한 파일입니다 . 이 기능은 Xcode 7 정도에 추가되었습니다.

두 번째 파일은 이름은 같지만 Xcode 's에 묻힌 파일입니다 DerivedData. 이 파일은 데이터 모델 ( ) 파일이 대상의 컴파일 소스 빌드 단계에 포함 된 경우 모든 빌드 중에 Xcode에 의해 자동으로 생성됩니다 . 이 기능은 Xcode 9 정도에 추가되었습니다. Codegen 팝업 의 설정에 따라 각 엔티티 / 클래스마다 하나 또는 두 개의 파일이 생성됩니다 . 데이터 모델 을 편집하는 동안 엔터티를 선택할 때 해당 팝업은 데이터 모델 관리자 에 있습니다..xcdatamodeld

데이터 모델 검사기의 스크린 샷

설정은 다음과 같습니다

  • 수동 / 없음 파일이 생성 되지 않습니다
  • 범주 / 확장 Objective-C 범주 또는 스위프트 확장을 포함하는 Foo + CoreDataProperties.m 또는 .swift 파일 하나 가 생성됩니다.
  • 클래스 정의 동일한 Category / Extension 파일이 생성되고 클래스 선언 및 정의가 포함 된 Foo + CoreDataClass.m 또는 .swift 가 생성됩니다.

따라서 이전 Xcode에 익숙한 개발자 (예 : 나와 같은)가 새로운 Xcode에서 프로젝트를 시작할 때 문제가 발생합니다. Codegen 팝업 의 설정으로 인해 Xcode가 중복 파일을 생성 한다는 것을 인식하지 못하고 Project Navigator에서 볼 수있는 파일을 생성하려면 Managed Object Subclass 생성 메뉴 항목 을 사용해야한다고 생각합니다. "네비게이터"는 프로젝트 네비게이터에 표시되지 않습니다. 개발자가 헤더의 주석 을 읽고 주의를 기울이는 것을 신뢰하지 않기 때문 입니다. //이 파일은 자동으로 생성되어 편집해서는 안됩니다.

해결 방법 1-이전 방식 사용

하나의 설정만으로 데이터 모델에 대해 모든 자동 Codegen비활성화 할 수 있습니다 .

  • 문제 대상의 오픈 빌드 페이즈 (에서 프로젝트 네비게이터 를 선택 프로젝트는 다음의 목록에 TARGETS 나타난 후, 탭 문제의 대상을 선택 빌드 페이즈 ).
  • 확장 컴파일 소스 항목을하고 문제 데이터 모델 (찾을 .xcdatamodeld파일).
  • 컴파일리스트에서 삭제
  • 데이터 모델이 번들 자원 복사 목록에 포함되어 있는지 확인하십시오 .

솔루션 2-초보자를위한 핵심 데이터 매직

여기, 당신은 더 새로운 길로 들어갑니다.

  • 해당 Compile Sources 에서와 같이 데이터 모델을 그대로 두십시오 .
  • 데이터 모델의 각 엔티티 검사기에서 Codegen클래스 정의로 설정하십시오 .
  • 프로젝트 탐색기에서 Foo + CoreDataClass 파일을 삭제하고 휴지통에 버리고 Foo + CoreDataProperties.m 또는 .swift 파일의 이름을 Foo + MyProperties 와 같은 이름으로 바꾸십시오 .
  • Foo + MyProperties.m 또는 .swift 파일에서 Xcode에 의해 생성 된 속성이있는 경우 Codegen에 의해 생성 된 숨겨진 파일에 있으므로 이러한 속성을 삭제하십시오 .

이 솔루션을 사용하면 클래스 정의가 각 빌드의 데이터 모델에서 자동으로 생성됩니다. 당신은 심지어 그들을 볼 수 없습니다. 그것은이다 코어 데이터 매직 , 초보자를위한 좋은 간단한.

솔루션 3-대부분의 실제 앱

그러나 관리되지 않는 속성을 실제로 추가하려는 경우 솔루션 2는 좋지 않습니다. (Objective-C에서는 속성을 범주에 추가 할 수 없으며 Swift에서는 저장된 속성을 확장에 추가 할 수 없습니다.) 따라서 대부분의 실제 응용 프로그램에서는 솔루션 1과 2 사이의 중간 지점을 원할 것입니다.

  • 데이터 소스컴파일 소스 목록에 두십시오.
  • 데이터 모델의 각 엔티티 검사기에서 CodegenCategory / Extension으로 설정하십시오 .
  • 프로젝트 네비게이터에서 Foo + CoreDataClass.m 또는 .swift 파일을 삭제하고 휴지통에 버리십시오. 향후 혼동을 줄이려면 Foo + CoreDataProperties.m 또는 .swift 파일의 이름을 Foo.m 또는 .swift로 바꾸십시오 .
  • Foo.m 또는 .swift 파일에 관리되지 않는 자체 속성을 추가 할 수있는 클래스 정의가 포함되어 있는지 확인하십시오 .

(Positron의 답변에 대한 감사의 말. 여기의 대답은 Positron의 답변 (내 솔루션 1)이 작동하는 이유를 설명하고 솔루션 2와 솔루션 3을 추가합니다.)


필자의 경우 PDFGenerator가 info.plist 파일을 생성 중이므로 방금 삭제했습니다.

여기에 이미지 설명을 입력하십시오


나는 같은 문제가 있었고 메인 앱에 도우미 앱이 하나 더 있고 이것을 리소스에 복사했습니다. 내 경우에는 다음과 같이 해결되었습니다.

1) 대상-> 2) 빌드 단계 2) 파일 복사 (n 개 항목) 3) 복사 파일 제거.

도우미 앱은 Xcode 10.0으로 자동 복사됩니다.

여기에 이미지 설명을 입력하십시오


여기에 제안 된 솔루션 중 어느 것도 나를 위해 일하지 않았습니다. 이것은 특히 CocoaPods 때문이었습니다. 나는 이전에 Cocoapods 1.3.1을 사용하고있었습니다. 1.5.3으로 업그레이드해도 문제가 바로 해결되지 않았습니다.

The steps I followed were:

  1. Delete Podfile.lock
  2. Delete Pods directory
  3. Delete Derived Data & Clean
  4. Exit Xcode
  5. Update CocoaPods to 1.5.3
  6. Run pod install
  7. Open workspace and build

Try all this option anyone of this 3 option will work for you, for sure

Option 1: Remove all files from

Target >> Build Phases >> Compile Sources

Target >> Build Phases >> Copy Bundle Resources

Option 2: Change the build system

Xcode->File->Project Settings-> Build System -> Legacy Build System

Option 3: remove and update existing pod

pod cache clean PromisesObjC
pod cache clean PromisesSwift
cd [your_project_dir]
rm -rf Pods/
rm Podfile.lock
pod update

I hope this will help you, Happy coding :-)

Before I begin note that my project utilizes Carthage as a dependency manager.

None of the existing answers here resolved my issue. What did resolve the issue for me was the following.

First, I noticed that the build error pointed out one framework in particular. Next I filtered App Target > Build Phases for that framework. I noticed that that framework was present in both "Link Binary With Libraries" and "Embed Frameworks". Noting that none of the frameworks listed under "Embed Frameworks" were ones managed by Carthage I removed the framework in question from "Embed Frameworks". I then re-built my project and everything works fine including the functionality enabled by the framework in question.


Steps:

  1. Go to Xcode File
  2. Click to WorkSpace Settings
  3. Build System Select as Legacy Build System

So the problem I was having is that I had accidentally included the Info.plist in the project settings -> Build Phases -> Copy Bundle Resources for my target.


I had bunch of Multiple commands produce warnings - not limited to info.plist duplication in one target. Including localized resources and string files, headers etc.

Solution: remove all duplications in target membership.


One option which solved my issue is to changing build system to legacy build system. Please follow the following steps in Xcode 10+ 여기에 이미지 설명을 입력하십시오

여기에 이미지 설명을 입력하십시오


Go in Project Build Phase and Remove info.plist from the Compile Sources. It will remove that issue and project will be active again.

여기에 이미지 설명을 입력하십시오


I using Carthage and Xcode 10.

My Solution is -> Project -> Target -> General ->

Remove the Frameworks added with Carthage from "Embedded Binaries"

usualy u have to add a script in Build Phases to strip the architecture for app store.

In Xcode 10 the script seems called always. So it copies the frameworks to the right place and you don't have to add them to the General Tab.

Note: if not set -> in Build Settings -> Search Paths -> Framework Search Paths -> set the path to the Framework u added with Carthage .... eg. "$(PROJECT_DIR)/Carthage/Build/iOS"


I had this problem when I had a file with the same name in two different targets. For some reason one of those files I had part of both targets. So basically I had two files. And both of those files belonged to one target.

It makes sense that a target can only have one file name per target, so just unchecking the target member box for the file that wasn't related to the main target fixed the issue.


My issue was in Xcode 10 being run in Mojave, and while trying to run unit tests that I wrote before updating to XCode 10.

In my case, I had this issue while running my TestTarget target. To resolve, I had to:

  • Delete one of the target dependency (in TestTarget > build phases > Target Dependencies)

since I had two other targets besides my TestTarget and both were running the same script and creating/copying files at a certain point.

And that conflicted with what was mentioned in Build System Release Notes for Xcode 10 here:

It is an error for any individual file in the build to be produced by more than one build command. For example, if two targets each declare the same output file from a shell script phase, factor out the declaration of the output file into a single target.

New UPDATE after I updated from Xcode 10.1 to 10.2

Similar issue again showed up after I updated to Xcode 10.2. I have multiple targets in by project: Target1 and Target2, and I solved this issue by:

  • navigating to Edit Scheme > Build and
  • removing one of the target from being built: uncheck the checkbox of Target1 under Test since I knew Target2 imported Target1

Also to note here, Target2's checkbox is to remain checked under Test


Had similar issue but with .swiftdoc files.

I have extensions and unit test targets in project. And they had same "Product Module Name" (PRODUCT_MODULE_NAME in Build Settings) as application. After making names unique issue gone.


Moving to Xcode 10, errors like

error: Multiple commands produce '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist':

can be solved as follows:

Go to Xcode->File->Workspace/Project Settings-> Build System -> Legacy Build System.


Here is another working solution : (If you are using Pods)

  • Select "Pods" from sidebar as highlights in screenshot.
  • Click on Build Phase. Expand "Headers" section. There are 3 options Public, Private, Project
  • Expand Public and check there are duplicate files. Remove it. DONE!!

여기에 이미지 설명을 입력하십시오


Select your scheme (top left corner) -> Edit Scheme... -> Build (left tab) -> uncheck "Find Implicit Dependencies"

여기에 이미지 설명을 입력하십시오

And after that you may need to fix any dependencies that were not imported explicitly by your targets.


One of my CocoaPods was oudated and caused the issue. Did an pods update and it worked fine.

I believe it may have been the LivePerson SDK


Search & Remove duplicate files those are produced from multiple commands.

여기에서 여분의 Info.plist파일을 제거해야합니다 (제 경우에는 Contents.json)

error: Multiple commands produce '/Users/uesr/Library/Developer/Xcode/DerivedData/OptimalLive-fxatvygbofczeyhjsawtebkimvwx/Build/Products/Debug-iphoneos/OptimalLive.app/Info.plist'

이것은 기본적으로 여러 파일 이름이 있음을 의미합니다 Info.plist. 일반적으로 문제는 없지만 실수로 파일이 동일한 대상 멤버십으로 설정되어 있습니다. 따라서 수정은 다음과 같습니다. 각 파일을 클릭하고 오른쪽에서 대상 멤버십을 확인하여 겹치지 않도록하십시오.

참고 URL : https://stackoverflow.com/questions/50718018/xcode-10-error-multiple-commands-produce



반응형