GTM(谷歌标签管理器)6.0与Firebase Analytics 5.0版本冲突

9

新的Firebase 5.0版本与Google Tag Manager发生版本冲突。是否有人有解决方案?

Podfile:

# Analytics
pod 'Firebase/RemoteConfig', '~> 5.0.0'
pod 'Firebase/Core', '~> 5.0.0'
pod 'GoogleTagManager', '~> 6.0'
pod 'GoogleIDFASupport'
pod 'GooglePlaces', '~> 2.7.0'

当我执行 pod install 命令时,出现以下错误:

[!] CocoaPods could not find compatible versions for pod "FirebaseAnalytics":
  In Podfile:

Firebase/Core (~> 5.0.0) was resolved to 5.0.0, which depends on
  FirebaseAnalytics (= 5.0.0)

Firebase/RemoteConfig (~> 5.0.0) was resolved to 5.0.0, which depends on
  FirebaseRemoteConfig (= 3.0.0) was resolved to 3.0.0, which depends on
    FirebaseAnalytics (~> 5.0)

GoogleTagManager (~> 6.0) was resolved to 6.0.0, which depends on
  FirebaseAnalytics (~> 4.0)

3
看起来谷歌在Firebase 5.0发布时没有更新Tag Manager pod。官方帮助论坛中有一张工单,如果我们给它点赞/回复,可能会有所帮助。 - Mark Thormann
2个回答

7
最近,谷歌发布了Google Tag Manager Pod版本7.0.0,这个问题得到了解决。

5

更新:此问题已在GoogleTagManager 7.0.0中解决。

过时的答案:似乎Firebase Analytics 5.x没有向后不兼容的更改,主要版本增加是由于iOS 7支持的放弃。 这不是我项目的问题,所以我只是为GoogleTagManager创建了修补程序podspec。

GoogleTagManager.podspec.json

{
  "authors": "Google, Inc.",
  "dependencies": {
    "FirebaseAnalytics": "~> 5.0",
    "GoogleAnalytics": "~> 3.17",
    "GoogleUtilities": "~> 1.3"
  },
  "description": "Google Tag Manager is a tool to easily deploy analytics and marketing tags.",
  "frameworks": [
    "AdSupport",
    "CoreTelephony",
    "JavaScriptCore",
    "SystemConfiguration",
    "UIKit"
  ],
  "homepage": "https://www.google.com/tagmanager",
  "libraries": [
    "sqlite3",
    "z"
  ],
  "license": {
    "text": "Copyright 2017 Google",
    "type": "Copyright"
  },
  "name": "GoogleTagManager",
  "platforms": {
    "ios": "7.0"
  },
  "resources": [
    "Frameworks/frameworks/GoogleTagManager.framework/Resources/TagManagerResources.bundle"
  ],
  "source": {
    "http": "https://dl.google.com/dl/cpdc/07041f585a34f209/GoogleTagManager-6.0.0.tar.gz"
  },
  "summary": "Google Tag Manager - create and update tags easily",
  "vendored_frameworks": [
    "Frameworks/frameworks/GoogleTagManager.framework"
  ],
  "version": "6.0.0"
}

Podfile

pod 'GoogleTagManager', podspec: './GoogleTagManager.podspec.json'

1
由于Google团队对这个问题不在乎,最好的方法是自己覆盖。感谢解决方案。 - ergunkocak

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接