Unity iOS Resolver는 Unity에서 사용할 수 있는 iOS 의존성 관리 툴입니다.
보통은 Unity 빌드를 하면 알아서 pods 설치 및 xcworkspace가 생성되어야 하는데, wcworkspace가 생성되지 않는 이슈를 발견하여 정리합니다.
#1 현상
Cocoapods 1.11.2를 사용하던 중, Unity iOS Resolver 설정 후 Unity 빌드 시 wcworkspace가 생성되지 않았습니다.
아래는 에러 로그입니다.
iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.
After the failure, "pod repo update" was executed and succeeded. "pod install" was then attempted again, and still failed. This may be due to a broken CocoaPods installation. See: https://guides.cocoapods.org/using/troubleshooting.html for potential solutions.
pod install output:
[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:
export LANG=en_US.UTF-8
[0m
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `unicode_normalize'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `installation_root'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:226:in `podfile_path'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:105:in `markdown_podfile'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:30:in `report'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:66:in `report_error'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `unicode_normalize'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `installation_root'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:226:in `podfile_path'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:205:in `podfile'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:160:in `verify_podfile_exists!'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:46:in `run'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'
에러 로그를 보면 뭔가 pods 설치하다가 실패를 했다고 합니다. 이것저것 조사하다가 3가지 해결방법을 찾았습니다.
#2 해결방법
1) 그냥 pod install 직접 호출
Unity 빌드를 하면 xcworkspace만 만들어지지 않을 뿐, xcodeproj는 생성됩니다.
Podfile이 문제가 없다면, 터미널로 가서 pod install을 직접 호출해줍니다.
(다만 이 방법은, Unity 빌드할 때마다 매번 pod install을 호출해줘야 합니다ㅠㅠ)
2) Use Shell to Execute Cocoapod Tool 체크박스 해제
Assets > External > Dependency Manager > iOS Resolver > Settings
로 가서 Use Shell to Execute Cocoapod Tool
체크박스를 해제해주세요.
(이 설정은 Cocoapods 명령어 실행 전에 shell 환경설정이 필요한 경우 사용하는 것으로 굳이 사용할 필요가 없다면 해제해도 무방할 것 같습니다.)
3) Cocoapods 1.10.x 버전으로 다운그레이드
Cocoapods 1.10.x 버전으로 다운그레이드 후에 다시 Unity 빌드를 하면 정상적으로 xcworkspace가 설치됩니다.
(현재 발생하는 이슈는 Cocoapdos 1.11.x의 버그라고 합니다....)
'TroubleShooting' 카테고리의 다른 글
[iOS] Unsupported Swift architecture 해결방법 (2) | 2023.02.11 |
---|---|
[Xcode 14] Asset validation failed 해결방법 (0) | 2022.12.31 |
[SwiftUI] '__designTimeInteger(_:fallback:)' is only available in iOS 13.0 or newer 에러 해결방법 (0) | 2022.11.05 |
[Xcode 14] Signing for "xxxx" requires a development team. 에러 (0) | 2022.10.26 |
[Unity] Undefined symbol: _OBJC_CLASS_$_XXXXXXXX 해결방법 (0) | 2022.10.07 |