pod install output:
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core":
In Podfile:
Firebase/Auth (= 10.6.0) was resolved to 10.6.0, which depends on
FirebaseAuth (~> 10.6.0) was resolved to 10.6.0, which depends on
GTMSessionFetcher/Core (< 4.0, >= 2.1)
GoogleSignIn (= 6.0.2) was resolved to 6.0.2, which depends on
GTMAppAuth (~> 1.0) was resolved to 1.3.1, which depends on
GTMSessionFetcher/Core (< 3.0, >= 1.5)
GoogleSignIn (= 6.0.2) was resolved to 6.0.2, which depends on
GTMSessionFetcher/Core (~> 1.1)
Firebase 10.6.0이 업데이트 돼서 다시 한 번 iOS 빌드를 시도해 봤는데 여전히 에러가 난다.
UnayOzan commented on Feb 5
Fixed this error with changing the version in "GoogleSignIn.podspec.json" file.
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)
GoogleSignIn (~> **5.0.2**) was resolved to **5.0.2**, which depends on
GTMSessionFetcher/Core (~> **1.1**)
I found the file in {user}.cocoapods/repos/cocoapods/Specs and then just search for "GoogleSignIn.podspec.json".
Find the folder with the same version with the error, in my case 5.0.2.
And then change its dependencies with the version 7.0.0 or something that works with the other packages.
In my project the solution was this;
"dependencies": {
"AppAuth": [
"~> 1.5"
],
"GTMAppAuth": [
">= 1.3",
"< 3.0"
],
"GTMSessionFetcher/Core": [
">= 1.1",
"< 4.0"
]
After that I exited Xcode, deintagrated pods, cleaned cache and installed it again.
Everything works fine now.
- 관련 에러 위치 찾아가서 Team Id를 선택하면 잘되긴 하는데, 빌드때마다 수동으로 하기는 애매해서 찾아보니 PodFile에 아래 내용을 추가하면 된다고 한다.
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
target.build_configurations.each do |config|
config.build_settings['CODE_SIGN_IDENTITY'] = ""
#prevent resource bundle from reading image nil
config.build_settings.delete('PRODUCT_BUNDLE_IDENTIFIER')
end
end
end
end
- iOS 빌드해서 PodFile 수작업을 계속할 수는 없는지라 Unity의 Xcode PostProcessBuild에서 자동으로 추가하도록 함.
(Define을 봐서는 Unity2019.3 이상에서만 가능한 것 같다)
#if UNITY_2019_3_OR_NEWER
// FixPodFile 사용법 참조
// https://github.com/googlesamples/unity-jar-resolver/issues/405 : Str4tos 댓글
[PostProcessBuild(45)]//must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and that it's added before "pod install" (50)
private static void FixPodFile(BuildTarget buildTarget, string buildPath)
{
/// Stop processing if target is NOT iOS
if (buildTarget != BuildTarget.iOS)
return;
using (StreamWriter sw = File.AppendText(buildPath + "/Podfile"))
{
// [Error 대응] (Xcode 14): Signing for "GoogleSignIn-GoogleSignIn" requires a development team.
// [해결방법 참조] https://github.com/CocoaPods/CocoaPods/issues/11402 : JosephPoplar 댓글
sw.WriteLine("\npost_install do |installer|\n installer.pods_project.targets.each do |target|\n if target.respond_to?(:product_type) and target.product_type == \"com.apple.product-type.bundle\"\n target.build_configurations.each do |config|\n config.build_settings['CODE_SIGN_IDENTITY'] = \"\"\n #prevent resource bundle from reading image nil\n config.build_settings.delete('PRODUCT_BUNDLE_IDENTIFIER')\n end\n end\n end\nend");
/// ex
//sw.WriteLine("\ntarget 'Unity-iPhone' do\nend");
}
}
#endif