ios - 在 Podspec 中未找到添加依赖项的此类模块
<p><p>我正在使用 Swift 在 iOS 中创建一个框架。我已经创建了 podspec 文件并将 googlemap 的依赖项放在我的框架中。</p>
<p>当我尝试在示例应用程序中安装我的框架时,它显示“GooogleMaps”的“没有这样的模块查找”。请告诉我如何在我的框架中链接谷歌地图,这样任何应用程序在安装我的 cocoapod 时都会自动获取谷歌地图而不会出现任何错误。</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>如果您已经创建了一个 <code>pod</code> 并且在您的 <code>.podspec</code> 文件中,您正在尝试添加一个 <code>dependency</code>(如 Alamofire、RealmSwift.. ) 之后,您应该<strong>转到 <code>Example/..</code> 文件夹并</strong> <strong>执行 <code>pod install</code> 以从 .您的自定义 <code>pod</code> 的 podspec 可见</strong> 到您的自定义 pod/framework 中的 .swift 文件。</p>
<p>pod 项目文件夹层次结构的典型示例是:</p>
<pre><code>- 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..)
</code></pre></p>
<p style="font-size: 20px;">关于ios - 在 Podspec 中未找到添加依赖项的此类模块,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/44884150/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/44884150/
</a>
</p>
页:
[1]