pod install 런타임에 `target overrides the OTHER_SWIFT_FLAGS build setting defined`가 표시되고 추가 된 라이브러리를로드 할 수 없습니다.

2190 단어 XcodeiOSSwift

환경



Xcode Version 12.4
MacOS BigSur 11.2.1

발생한 문제



프로젝트의 Podfile에 SnapKit을 추가하고 pod install를 실행하면,Cannot load underlying module for ‘SnapKit' 문제가 발생했습니다.
추가한 라이브러리의 임포트는 할 수 있지만 로드가 되어 있지 않은 모습.
$ pod install

Analyzing dependencies
Downloading dependencies
Installing SnapKit (5.0.1)
Generating Pods project
Integrating client project
Pod installation complete! There are 12 dependencies from the Podfile and 22 total pods installed.

[!] The `MySampleApp [Debug]` target overrides the `OTHER_SWIFT_FLAGS` build setting defined in `Pods/Target Support Files/Pods-MySampleApp/Pods-MySampleApp.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.



해결 방법


[!] 의 안내대로 대상 설정에 $(inherited) 를 추가한다.

절차



xcodeproj → TARGETS → Build Settings → 오른쪽 상단의 검색창에서 other_swift라든지 검색하면 아래와 같은 항목이 나온다.
※ 특별히 설정하지 않은 경우는 화상과 달리 공란이 되어 있을 것



대상 체계의 우측의 란을 더블 클릭하면 아래와 같은 화면이 열리므로,+ 아이콘을 클릭하여 $(inherited)를 항목에 추가


이것으로 설정이 완료되었습니다.
다시 pod install 그러면 메시지가 사라지고 라이브러리가로드 될 수 있습니다.

설명



설정 파일의 내용을 상속( inherited ) 해 덧쓰기해 갈 필요가 있다고 합니다만,
이번 경우는 그 계승 관계가 도중에 끊어져 있었기 때문에, 정상적으로 반영할 수 없었던 것 같습니다.
참고 : XCode의 Build Settings에서 값이 결정되는 규칙 - Qiita

좋은 웹페이지 즐겨찾기