我正在使用 Swift 在 iOS 中创建一个框架。我已经创建了 podspec 文件并将 googlemap 的依赖项放入我的框架中。
当我尝试在示例应用程序中安装我的框架时,它为“GooogleMaps”显示“找不到这样的模块”。请告诉我如何在我的框架中链接谷歌地图,这样任何应用程序在安装我的 cocoapod 时都会自动获取 GoogleMaps 而不会出现任何错误。
最佳答案
如果您已经创建了一个 pod
并且在您的 .podspec
文件中您正在尝试添加一个 dependency
(例如 Alamofire、RealmSwift.. ) 之后,您应该转到 Example/..
文件夹并 执行 pod install
以从 .自定义 pod
的 podspec 对自定义 pod/框架中的 .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 - No Such Module Found 在 Podspec 中添加依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44884150/