【问题标题】:adding ios core framework to podfile将 ios 核心框架添加到 podfile
【发布时间】:2018-07-13 20:06:22
【问题描述】:

我在 Podfile 中添加了一个 pod,但在构建时遇到了编译器错误:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_CLLocation", referenced from:
     objc-class-ref in MoPubAdapter(GADMAdapterMoPub.o)
  ld: symbol(s) not found for architecture arm64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)

然后我去Build Settings > Target > Debug > Other Linker Files手动添加-framework"CoreLocation"

编译器不再抱怨了。我认为它们被遗忘为吊舱的先决条件。

现在我不喜欢手动更改此值的事实。如果 Cocoapods 即再次覆盖此值,我可能会忘记这样做。有没有办法让我将 CoreLocation 框架添加到 Podfile 以便 Cocoapods 负责包含它?

谢谢

【问题讨论】:

    标签: ios admob cocoapods podfile linker-flags


    【解决方案1】:

    恐怕没有办法做到这一点。 Apple 不提供其核心框架对 Cocoapods 的依赖。作为测试,您可以在 Cocoapods 上搜索任何核心库。你不会发现的。作为一个简短的测试,如果您尝试在 Podfile 中设置pod CoreLocation,结果如下。

    遗憾的是,手动修复此问题是唯一的解决方法。

    【讨论】:

      【解决方案2】:

      您可以在 Podfile 中将依赖项添加到仅向 CoreLocation 添加依赖项的最小 CocoaPod。请参阅 here 创建 podspec 和 here 从本地路径引用 podspec。

      更好的解决方案是更新有问题的 pod 的 podspec,将 CoreLocation 添加为 framework

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-01-19
        • 2019-02-25
        • 1970-01-01
        • 2020-05-30
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多