OGeek|极客世界-中国程序员成长平台

标题: ios - 在 Podspec 中未找到添加依赖项的此类模块 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 20:01
标题: ios - 在 Podspec 中未找到添加依赖项的此类模块

我正在使用 Swift 在 iOS 中创建一个框架。我已经创建了 podspec 文件并将 googlemap 的依赖项放在我的框架中。

当我尝试在示例应用程序中安装我的框架时,它显示“GooogleMaps”的“没有这样的模块查找”。请告诉我如何在我的框架中链接谷歌地图,这样任何应用程序在安装我的 cocoapod 时都会自动获取谷歌地图而不会出现任何错误。



Best Answer-推荐答案


如果您已经创建了一个 pod 并且在您的 .podspec 文件中,您正在尝试添加一个 dependency(如 Alamofire、RealmSwift.. ) 之后,您应该转到 Example/.. 文件夹并 执行 pod install 以从 .您的自定义 pod 的 podspec 可见 到您的自定义 pod/framework 中的 .swift 文件。

pod 项目文件夹层次结构的典型示例是:

- SMCustomPod/
  - _Pods.xcodeproj
  - Example/ // <-- do a pod install under this folder in order to get the dependencies declared in your .podspec
    - Podfile
    - SMCustomPod.xcodeproj
    - SMCustomPod.xcworkspace
  - SMCustomPod/
    - Classes/ // <-- folder with pod specific logic that also uses Alamofire
    - Assets/
  - SMCustomPod.podspec  // <-- your podspec with dependencies (Alamofire..)

关于ios - 在 Podspec 中未找到添加依赖项的此类模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44884150/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4