如何使用依赖关系创建CocoaPod?

Mac*_*eus 1 xcode cocoapods

我正在使用command生成的框架pod lib create

我想创建一个依赖其它两个荚荚:PromiseKitAWSS3。然后,我更改Podfile:

use_frameworks!

target 'ruawss3_Example' do
  pod 'ruawss3', :path => '../'
  pod 'AWSS3'
  pod 'PromiseKit', '~> 4.0'

  target 'ruawss3_Tests' do
    inherit! :search_paths

    pod 'Quick'
    pod 'Nimble'
    pod 'FBSnapshotTestCase'
    pod 'Nimble-Snapshots'
  end
end
Run Code Online (Sandbox Code Playgroud)

并使用pod install

?  Example git:(master) ? pod install
Analyzing dependencies
Fetching podspec for `ruawss3` from `../`
Downloading dependencies
Using AWSCore (2.4.16)
Using AWSS3 (2.4.16)
Using FBSnapshotTestCase (2.1.4)
Using Nimble (5.1.1)
Using Nimble-Snapshots (4.4.0)
Using PromiseKit (4.1.0)
Using Quick (1.0.0)
Using ruawss3 (0.1.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 7 dependencies from the Podfile and 8 total pods installed.
?  Example git:(master) ? pwd
/Users/brunomacabeusaquino/ApenasMeu/Dropbox (BEPiD)/Swift/ruawss3/Example
Run Code Online (Sandbox Code Playgroud)

并将此pod添加到项目中: 在此处输入图片说明

但是,我无法在Pods>开发Pod> ruawss3> ruawss3>类> AmazonS3.swift中编译文件。Xcode找不到模块“ AWSCore”。如何解决?

Mac*_*eus 6

我解决了我的问题。

使用pod .podspecsettings 依赖关系,添加pod依赖关系的正确位置在文件中。然后,执行pod install

  • 我有一个“ MyProject.podspec”,没有“ Podfile”。在podspec中,我声明了我的依赖项。运行`pod install`时,在项目目录中找不到`[!] Podfile。有任何想法吗? (2认同)