pod install output:
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core":
In Podfile:
Firebase/Auth (= 10.4.0) was resolved to 10.4.0, which depends on
FirebaseAuth (~> 10.4.0) was resolved to 10.4.0, which depends on
GTMSessionFetcher/Core (< 4.0, >= 2.1)
최근 Firebase 10.x 버전이 Xcode 14.x 버전에서 위와 같은 오류를 내면서 빌드가 제대로 되지 않는 문제가 있어서 이리저리 알아보니 구글에서 확인하고 수정중이라고 하는 것 같다.
pod install output:
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Firebase/Messaging":
In Podfile:
Firebase/Messaging (= 10.4.0)
None of your spec sources contain a spec satisfying the dependency: `Firebase/Messaging (= 10.4.0)`.
pod 를 업그레이드 후에 pod install 시에 다음과 같은 경고 문구를 만날 수 있다.
[!] Your project does not explicitly specify the CocoaPods master specs repo. Since CDN is now used as the default, you may safely remove it from your repos directory via `pod repo remove master`. To suppress this warning please add `warn_for_unused_master_specs_repo => false` to your Podfile.
이 이슈와 연관이 있다. git 기반의 MasterSource 대신 CDN 기반의 TrunkSource 로 변경되었기 때문. 하지만 BLM 과 관련 있는 듯.
이것도 Master 라는 용어를 사용하지 않기 위함?? github 에서 메인 소스 브랜치 이름이 master 에서 main 으로 변경된 것과 비슷한 이유인듯. 추정..
GoogleMobileAds iOS SDK 7.68 이상은 Firebase 7.x 이상에서 지원합니다.
Firebase 업데이트 하세요
Unity: 2019.4.8f1
AdMob v5.4.0
Firebase v6.16.1 (Messaging & Analytics)
Target minimum iOS Version 12.0
Problem
I can't build the project. XCode error:
../Libraries/Plugins/iOS/GADUAdLoader.h:5:9: 'GoogleMobileAds/GoogleMobileAds.h' file not found
When I trying to update pods terminal throw the next error:
[!] CocoaPods could not find compatible versions for pod "GoogleAppMeasurement":
In Podfile:
Firebase/Analytics (= 6.32.2) was resolved to 6.32.2, which depends on
Firebase/Core (= 6.32.2) was resolved to 6.32.2, which depends on
FirebaseAnalytics (= 6.8.2) was resolved to 6.8.2, which depends on
GoogleAppMeasurement (= 6.8.2)
Google-Mobile-Ads-SDK (~> 7.68) was resolved to 7.68.0, which depends on
GoogleAppMeasurement (~> 7.0)
Attempts
Add 'pod 'GoogleAppMeasurement', '7.0'' to Podfile.
Result
CocoaPods could not find compatible versions for pod "GoogleAppMeasurement":
In Podfile:
Firebase/Analytics (= 6.32.2) was resolved to 6.32.2, which depends on
Firebase/Core (= 6.32.2) was resolved to 6.32.2, which depends on
FirebaseAnalytics (= 6.8.2) was resolved to 6.8.2, which depends on
GoogleAppMeasurement (= 6.8.2)
Google-Mobile-Ads-SDK (~> 7.68) was resolved to 7.68.0, which depends on
GoogleAppMeasurement (~> 7.0)
GoogleAppMeasurement (= 7.0)
Uninstall and install cocoapods
Result
Same error
Project Podfile
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/CocoaPods/Specs'
platform :ios, '12.0'
target 'UnityFramework' do
pod 'Firebase/Analytics', '6.32.2'
pod 'Firebase/Core', '6.32.2'
pod 'Firebase/Messaging', '6.32.2'
pod 'Google-Mobile-Ads-SDK', '~> 7.68'
end
How can I resolve this problem?
[Answer]
Google-Mobile-Ads-SDKversion 7.68 is only compatible with Firebase 7.x. If you want to use Firebase 6.x, you need to use 7.67 or earlier.
Podfile.lock에는 CHECKSUM이 부여됩니다. Podfile.lock의 유일성을 보증하는 해쉬값인 셈이죠. 만약 버전에 변경이 생기면 CHECKSUM 또한 변하게 됩니다.
pod update
pod update {팟이름}을 실행시키면, 코코아팟은 해당 팟의 업데이트된 버전이 있는지 검색합니다. Podfile.lock을 참조하지 않죠. 이 명령어는 팟을최신 버전으로 업데이트시켜주는 것입니다. (단, Podfile의 버전 조건과 일치해야 합니다.) 단순하게pod update만 실행시키면 코코아팟은 모든 팟에 대해 가능한 최신 버전으로 업데이트를 실행합니다.
pod outdated
pod outdated를 실행하면, 코코아팟은 Podfile.lock에 리스트된 것보다 새로운 버전을 가진 모든 팟을 나열합니다. 이 팟들에 대해pod update {팟이름}을 실행한다면 업데이트가 될 것이라는 것을 의미합니다. (역시나 Podfile의 버전 조건과 부합하는 한!)
pod repo update
/Users/{사용자이름}/.cocoapods/repos에 있는 모든podspec파일을 업데이트 합니다.podspec파일에는 해당 pod 의 주소 등 중요한 정보들이 담겨있습니다.
~/.cocoapods/repos에는 모든 pod에 대해 가능한 버전들의podspec파일들이 모여있습니다.pod repo update를 실행하게 되면 최신podspec파일들로 업데이트되게 되는 것입니다. 추가한 라이브러리에 대한podspec이 업데이트되지 않아 오류가 날 경우 이 명령어를 통하여 해결할 수 있습니다.
Podfile.lock을 커밋하세요!
동료와 같이 협업하고 있다면! 꼭Podfile.lock을 공유해야 합니다. pod 버전을 모두가 동일하게 쓰도록 유지시키는 역할을 하는 것이죠. 그리고 Podfile이 수정될 일이 생긴다면pod install명령어를 통해 의존성을 관리하면 됩니다. 만약 동료들과 같은 CHECKSUM을 얻는데에 실패했다면 간단하게rm -rf Pods && pod install을 실행하면 됩니다. 😎