상세 컨텐츠

본문 제목

Pod Pop Error

Swift

by ArtiOS 2023. 3. 28. 13:45

본문

프로젝트를 진행하기 위해 여타 라이브러리를 받던 도중 cocoa pod을 이용하여 받은 라이브러리중        

'POP' 라이브러리에서 문제가 생겼다. 이 라이브러리는 내가 직접 사용한 라이브러리도 아니고.      

사용한 라이브러리가 간접적으로 사용한 라이브러리였다.      

 

이 라이브러리 외에도 에러가 난 라이브러리가 존재하지만 이 pop이 가장 크게 에러를 발생 시켰기
때문에 이를 해결한 과정에 대해 기술할 것 이다.

일반적인 에러라면 구글과 챗 gpt의 결합으로 손쉽게 해결할 수 있었겠지만 역부족이었다.
이 역경을 기록해 보고자 한다.


Error : No type named 'string' in namespace 'std'

 

 단순하게 생각해보면 #include <string> 과 같은 구문이 빠져 발생한 오류라고 생각되어,

이 헤더를 포함시키면 되는 게 아닌가 싶기도 하지만 아니었다.

직접 추가하기에는 2015년도경에 obj-c 로 제작된 라이브러리를 건들기에는
아직 역부족이라고 생각되었고, 해당 오류가 발생한 파일에 멀쩡하게 헤더가 포함되어 있었기 때문에
내가 아는 일반적인 방식으로는 해결하지 못할 것임을 직감했다.

 

멀쩡하게 추가되어 있는데 왜 인식을 못하니

해당 라이브러리 : https://github.com/facebookarchive/pop


 

일단 해당 프로젝트의 다른 라이브러리와 충돌이 나서 그런것이 아닌가 싶어 새로운 프로젝트에 분리를 하고 테스트를 진행하였다.

그리고 당연하게도 분리하는것 만으로는 문제가 해결되지 않았다.
심지어 다른 분들에게 부탁해서 팟파일을 설치해보니 정상적으로 잘 설치가 되는 것 이었다!

해결하기

1. pod 재설치

2. 프로젝트 재설치 후 pod 재설치

3. pop library 최신버전으로 받기

4. xcode compatible 13.0 으로 설정하기

5. 아키텍처를 x86_64으로 지정하여 pod 재설치 하기 (m1문제)

6. 해당 library issue 뒤져보기 

- https://github.com/facebookarchive/pop/issues/408

- https://github.com/facebookarchive/pop/issues/302

- https://github.com/facebookarchive/pop/issues/310

- https://github.com/facebookarchive/pop/issues/15

 

use pop as a dependency of a custom pod will not compile · Issue #310 · facebookarchive/pop

I have main project, and a framework project. In the main project, I use the framework project as a pod. pod 'MyCustomPod' My framework project use pod as a pod, so I write s.dependency 'pod', '~> ...

github.com

 

Pop Integration - Linker Failure · Issue #302 · facebookarchive/pop

Hi - this is probably not a bug per se but wanted to check if folks have encountered this issue before and any workarounds available? I'm integrating the Pop framework directly within a blank / new...

github.com

 

iostream file not found - Xcode 9.3.1 - Swift 4 · Issue #408 · facebookarchive/pop

Hi, I just upgraded a project from swift 3.3 to swift 4.1. Every time I try to compile the project I get this error. I'm not sure what I need to do. Suggestions?

github.com

7. 빌드 클린 (cmd +shift + k)

8. xcode, 맥북 재부팅

9. xcode 업데이트

10. os 업데이트

11. library 직접 수정 (최후의 방법)

 

다행히 9번방법까지 실행하고 나서 문제를 해결 할 수 있었다.

이래서 xcode를 최신버전으로 유지하라는 것이구나!!!!!!!!!!!!!!!!!!!!


업데이트를 진행하고 나서도 

[Xcode] library not found for -l-lc++

라는 오류가 또 발생했지만 이전에 원본 레포에서 이슈를 뒤진게 도움이 되었다.

느낌상 기본적으로 있어야 할 c++ 라이브러리가 빠진게 문제라는것을 알았고 추가하는 것으로 문제가 해결 되었다.

(기본인데 왜 내꺼에만 빠져있지???)

 

https://github.com/devdawei/libstdc-

 

GitHub - devdawei/libstdc-: Xcode 10 之后删除的 libstdc++ 库

Xcode 10 之后删除的 libstdc++ 库. Contribute to devdawei/libstdc- development by creating an account on GitHub.

github.com

 

에서 실제 디바이스용 (3번) 파일과 시뮬레이터용 (4번) 파일을 받아 

xcode 내부의 lib파일에 추가해주었다.

Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/

-> 실제 디바이스용 파일을 추가한다. (3번파일 모두)

Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib

-> 시뮬레이터용 파일을 추가한다. (4번파일 모두)

해결!!!

결론 : Xcode를 꾸준히 업데이트 하자