ios - 无法通过 'pod install' 命令安装库

标签 ios swift xcode cocoapods

在执行命令 pod install 时出现以下错误。

gsirn-021308:ApplePaySwag-Starter chandeln$ pod install
Analyzing dependencies
[!] Unable to find a target named `ApplePaySwag`, did find `    ` and `ApplePaySwagTests`.

这是我的目录结构:

gsirn-021308:ApplePaySwag-Starter chandeln$ ls -l
total 16
drwxr-xr-x@ 16 chandeln  staff  544 Oct  3 16:56 ApplePaySwag
drwxr-xr-x@  5 chandeln  staff  170 Oct  3 16:56 ApplePaySwag.xcodeproj
drwxr-xr-x   4 chandeln  staff  136 Sep 15 15:38 ApplePaySwag.xcworkspace
drwxr-xr-x@  4 chandeln  staff  136 Sep 15 14:21 ApplePaySwagTests
-rw-r--r--@  1 chandeln  staff  455 Oct  3 17:44 Podfile
-rw-r--r--   1 chandeln  staff  209 Sep 19 11:12 Podfile.lock
drwxr-xr-x   8 chandeln  staff  272 Oct  3 17:44 Pods


gsirn-021308:ApplePaySwag-Starter chandeln$ pod --version
1.0.1

播客文件

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

target 'ApplePaySwag' do

  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for ApplePaySwag
  pod 'SwiftyJSON'
  pod 'SwiftyXMLParser', :git => 'https://github.com/yahoojapan/SwiftyXMLParser.git'

  target 'ApplePaySwagTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

不确定我在这里错过了什么。请指导。

最佳答案

已添加为答案,因此您可以将其标记为已接受并关闭问题:

A target here is not a file, it's a build target described inside your xcodeproj. Open the xcworkspace, select your ApplePaySwag.xcodeproj and inside the bar that says "General", "Build settings" and such, all the way to the left, click on the blue xcodeproj icon and select rename the target that seems to be named " ".

关于ios - 无法通过 'pod install' 命令安装库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39840939/

相关文章:

ios - 此类不符合关键图像的关键值编码

iOS,应用程序商店的 url 方案既适用于指定开发人员的应用程序,也适用于他在 iOS 6 中更新的具体应用程序?

swift - keyEquivalent 与 Swift 中的非字母数字字符

ios - swift : fatal error: unexpectedly found nil and EXC_BAD_INSTRUCTION

swift - 如何在 Swift 中声明一个作为属性名称的函数参数

ios - 如何安全地卸载旧的 Xcode beta

ios - native 链接错误无法为 XXX 创建紧凑展开,不使用标准框架 (MT5209)

ios - 使用自定义 NSURLProtocol 和 HTTP 代理处理重定向

iphone - Xcode:是否可以向按钮、图像等对象添加手势识别器

swift - 添加 Firebase iOS SDK(4.3.0 或更高版本)或 Unity 插件(6.15.0 或更高版本),然后构建、运行和崩溃您的应用