나의 발자취

iOS linker command failed with exit code 1 (use -v to see invocation), apple mach-o linker error 해결 본문

앱 개발/iOS

iOS linker command failed with exit code 1 (use -v to see invocation), apple mach-o linker error 해결

달모드 2021. 7. 4. 02:55

 

일단 Podfile의 오류를 방지하기 위해 Xcode에서 빌드하면 안되고, .project 파일도 아닌 .xcworkspace 파일을 XCode에서 Open해야한다.

 

앱이름을 변경하고 다른 기기에서 컴파일하는 경우에 이런 에러가 날 수 있다고 한다.

 

 

해결방법

1. General의 deployment info에서 iOS version을 기존의 10.0에서 11.0으로 올림

2. 그리고 조금 더 아래로 내려 libPods.a 파일을 삭제해준다.

3. Build Settings에서 Enable Bitcode를 Yes로 설정한다.

그리고 궁극적으로 위의 방법을 다 해도 안되면 XCode를 닫고, 폴더명을 바꾼다. 그리고 새로운 폴더를 생성하여 그 이름을 방금 바꾼 폴더 이름으로 설정 > 프로젝트 실행하고, 프로젝트 중지 > 새 폴더 삭제 > 기존 폴더명 다시 바꾸기 > 재실행

 

(출처)

Close Xcode, rename the folder. Then make a new folder with the previous name. Run the project, stop the project. Delete the new folder, rename old folder and re-run. 

https://stackoverflow.com/questions/35290063/linker-command-failed-with-exit-code-1-when-using-google-analytics-via-cocoapo

 

 

이렇게 해도 안된다면 Search Paths로 간다. 나의 경우 에러 유형이 -L이기 때문에 라이브러리에서 발생한 오류이다. 

Library Search Paths에서 경로를 모두 삭제한다.

나의 경우

 

 

와 같이 CocoaAsyncSocket에서 발생한 문제이기 때문에,

디버그 섹션을 더블클릭하여 해당 파일을 삭제한다.

 

https://stackoverflow.com/questions/9458739/ld-warning-directory-not-found-for-option

 

‘ld: warning: directory not found for option’

When I'm building my Xcode 4 apps I'm getting this warning: ld: warning: directory not found for option '-L/Users/frenck/Downloads/apz/../../../Downloads/Google Analytics SDK/Library' ld: warning:

stackoverflow.com

그래도 안되면

https://stackoverflow.com/questions/9458739/ld-warning-directory-not-found-for-option

Comments