새소식

인기 검색어

iOS/Xcode

Configurations 사용시 주의점

  • -

모듈화시 각 모듈에서 사용하는 ThirdParty Library들의 효율적인 관리를 위해 ThirdPartyKit이라는 모듈로 분리하여 사용하였다.

123

App 테스트를 위해 Configurations를 각각 다르게 줘고 Scheme를 각각 설정하였다.

Dev, QA, Release Scheme이다

4567

App-Release 스키마와 App-Dev 스키마는 정상적으로 실행되는데 App-QA 스키마는 아래와 같은 에러가 발생한다.

Framework 'ThirdPartyKit' not found
Linker command failed with exit code 1 (use -v to see invocation)

~/DerivedData/프로젝트이름/Build/Products의 폴더를 들어가 각각의 폴더를 확인해보면

QA에만 ThirdPartyKit.framework만 포함되어 있지 않고 있다.

하지만 ThirdPartyKit에 추가한 라이브러리들(SnapKit)은 다 포함되어있다

891011

ThirdPartyKit.framework가 포함되지 않는 이유는 ThirdPartyKit의 Configurations와 App의 Configurations가 일치하지 않기 때문이다.

12131415

당연하게도 Configurations의 Name은 일치해야 하고

16

App에 Configurations을 추가할 경우 참조하고 있는 모든 framework의 Configurations를 App과 맞춰줘야 한다.

App에 AnotherFramework 추가

AnotherFramework에 QA Configurations를 추가하기 전 App Build Fail

17

 

18

AnotherFramework에 QA Configurations를 추가한 후 App Build Success

19

 

 

Example

 

https://github.com/junbok97/TIL/tree/main/Swift/%EB%B8%94%EB%A1%9C%EA%B7%B8/Framework-Configurations

 

TIL/Swift/블로그/Framework-Configurations at main · junbok97/TIL

Today I Learn. Contribute to junbok97/TIL development by creating an account on GitHub.

github.com

 

Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.