across
V2EX  ›  iOS

咨询下 XCode 在多个子项目引用相同静态库造成的问题

  •  
  •   across · May 25, 2018 · 2389 views
    This topic created in 2967 days ago, the information mentioned may be changed or developed.

    一个比较麻烦的 iOS 编译问题,XCode 工程结构是这样的: 一个主项目 MainProject,下面包含了两个子项目,一个是 lib-UnityIphone (就是 unity3d 游戏引擎打包出来的库,不开源,无内部代码),另一个 lib-CoMagicFont (字体相关的库,有全部代码),这两个库里面都引用了开源 freetype 字体库。也就是说,当前工程下,打包进去了两个 freetype.a。

    问题来了,App 运行时,lib-UnityIphone 一初始化就 Crash,debug 后发现,这个库在访问 freetype 代码时,似乎“跳跃”到了 lib-CoMagicFont 的那个版本去了。因为 lib-UnityIphone 不开源,我尝试在 lib-CoMagicFont 中移除 freetype 试了下,果然能顺利运行了。

    那么,该怎么解决呢?现在只想到一个方法,将 lib-MagicFont 中的 freetype 全部替换成源代码形式再编译,不过工作量感觉会大不少。 不明白的一点是,lib-UnityIphone 运行时,为什么会定位到 lib-CoMagicFont .a 里面的 freetype.a, 在工程结构上还有其他解决方法吗?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3069 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:32 · PVG 21:32 · LAX 06:32 · JFK 09:32
    ♥ Do have faith in what you're doing.