代码之家  ›  专栏  ›  技术社区  ›  MajorShepard

两个Google pod之间的重复符号

  •  4
  • MajorShepard  · 技术社区  · 9 年前

    我知道 duplicate symbol 这是一个经常出现的问题,但这个问题很特别,至少我在iOS开发方面的知识对我没有帮助。

    我曾经在我的最终应用程序中使用GooglePlayGames(GPG),在我的SDK中使用GoolCloudMessaging(GCM),但今天由于某些原因,事情开始爆发(想法:由于上次GCM更新,但我无法获得旧版本)

    考虑到我的SDK中GCM的最新版本,我有:

    播客文件

    pod 'MySDK'                 # All good
    pod 'Google/CloudMessaging' # Nothing special...
    

    输出

    $ pod update
    Update all pods
    Updating local specs repositories
    Analyzing dependencies
    Downloading dependencies
    ...
    Installing GGLInstanceID (1.1.5)                 # Dependencies
    Installing Google (1.3.2)                        # relative to GCM
    Installing GoogleCloudMessaging (1.1.2)            
    Installing GoogleIPhoneUtilities (1.1.1)
    Installing GoogleInterchangeUtilities (1.1.0)
    Installing GoogleNetworkingUtilities (1.0.0)
    Installing GoogleSymbolUtilities (1.0.3)
    Installing GoogleUtilities (1.1.0)
    ...
    Generating Pods project
    Integrating client project
    

    在我的最终申请中:

    播客文件

    pod 'GooglePlayGames' # Nothing special...
    

    输出

    $ pod update
    Update all pods
    Updating local specs repositories
    Analyzing dependencies
    Downloading dependencies
    ...
    Installing GoogleAppUtilities (1.0.0)           # Dependencies relative
    Installing GoogleAuthUtilities (1.0.1)          # to GPG
    Installing GooglePlayGames (5.0)
    Installing GooglePlusOpenSource (1.7.1)
    Installing GoogleSignIn (2.4.0)
    ...
    Generating Pods project
    Integrating client project
    

    当我构建我的最终应用程序时,这是我遇到的错误(很明显,但我没有找到任何解决方案…)

    duplicate symbol _OBJC_CLASS_$_GIPLocale in:
    /Users/Path/To/App/Pods/GoogleIPhoneUtilities/Libraries/libGIP_Locale.a(GIPLocale.o)
    /Users/Path/To/App/Pods/GooglePlayGames/gpg-cpp-sdk/ios/gpg.framework/gpg(GIPLocale.o)
    

    据我所知,我有 GIPLocale 两次,这让我有了重复的符号。如果我们看看相关的Pods,其中一个属于 GPG 另一个是 GCM .

    我尝试了很多事情,但没有成功。 这可以很容易地用一个空项目复制,并在同一个Podfile中添加两个依赖项。请注意 ENABLE_BITCODE 必须禁用。

    可能是在某个地方,在Xcode配置中丢失了一些愚蠢的东西。。。

    2 回复  |  直到 9 年前
        1
  •  0
  •   MajorShepard    9 年前

    我已经创建了 same issue 在…上 Google Clound Messaging Github 答案很清楚,这是一个他们需要修复的bug。

    希望它很快就会到来。

        2
  •  0
  •   Anonymous    9 年前

    您是否尝试过删除第一个库(libGIPLocale.a)?这听起来确实像是两个库直接使用同一个内部库的问题(因此真正的修复不是在你的端部),但如果它们试图获取的代码是相同的,那么简单地不尝试在副本中链接就可以很好地解决链接问题。