【问题标题】:Why Spec lint throwing error Xcode build failed: Returned an unsuccesful exit code?为什么 Spec lint 抛出错误 Xcode build failed: Returned an unsuccessful exit code?
【发布时间】:2019-02-26 01:09:18
【问题描述】:

我正在尝试通过 cocoapods 创建一个自定义框架以在我的 Xcode 项目中使用。我按照此处提供的指南进行操作:https://guides.cocoapods.org/making/specs-and-specs-repo.html

当我尝试 lint 我的 pod 文件(通过 Podspec create 创建)时,我会收到以下错误:

ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.

The specific build system error: Build system information
    error: Multiple commands produce 

软件详情:

Xcode 版本:版本 10.0 (10A255) Swift 版本:Swift 4.2 Cocoapods 版本:1.6.0.beta.1

这些是我复制的步骤:

Pod 规范文件

 Pod::Spec.new do |s|

      s.name         = "iMessageFramework"
      s.version      = "1.0.0"
      s.summary      = "Small test to test code sharing via cocoapods."
      s.description  = "This is some superl oco framework that was made by 
       kevin vugts."
      s.homepage     = "https://github.com/kevinvugts/"
      s.license      = "MIT"
      s.author       = { "Kevin Vugts" => "kevin-vugts@live.com" }
      s.platform     = :ios, "11.0"
      s.source       = { :git => 
     "https://github.com/kevinvugts/iMessageFramework.git", :tag => "1.0.0" 
       }
      s.source_files = "iMessageFramework/**/*"
      s.swift_version = '4.2'
      s.ios.deployment_target  = '11.0'
    end

错误输出:

MBP-van-Kevin-2:iMessageFramework kevin$ pod spec lint --verbose --no-clean

    iMessageFramework (1.0.0) - Analyzing on iOS 11.0 platform.
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-App`: (``)

Fetching external sources
-> Fetching podspec for `iMessageFramework` from `/Users/kevin/Highstreet Mobile/FrameworkSharing/iMessageFramework/iMessageFramework.podspec`

Resolving dependencies of 

Comparing resolved specification to the sandbox manifest
  A iMessageFramework

Downloading dependencies

-> Installing iMessageFramework (1.0.0)
  > Copying iMessageFramework from `/Users/kevin/Library/Caches/CocoaPods/Pods/External/iMessageFramework/0e4f1587b607565154c390528a4b4ee6-5052a` to
  `../../../../../private/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/iMessageFramework`
  - Running pre install hooks

Generating Pods project
  - Creating Pods project
  - Adding source files to Pods project
  - Adding frameworks to Pods project
  - Adding libraries to Pods project
  - Adding resources to Pods project
  - Linking headers
  - Installing targets
    - Installing target `iMessageFramework` iOS 11.0
      - Generating module map file at `../../../../../private/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/Target Support
      Files/iMessageFramework/iMessageFramework.modulemap`
      - Generating umbrella header at `../../../../../private/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/Target Support
      Files/iMessageFramework/iMessageFramework-umbrella.h`
      - Generating Info.plist file at `../../../../../private/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/Target Support
      Files/iMessageFramework/iMessageFramework-Info.plist`
      - Generating dummy source at `../../../../../private/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/Target Support
      Files/iMessageFramework/iMessageFramework-dummy.m`
    - Installing target `Pods-App` iOS 11.0
      - Generating Info.plist file at `../../../../../private/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/Target Support
      Files/Pods-App/Pods-App-Info.plist`
      - Generating module map file at `../../../../../private/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/Target Support
      Files/Pods-App/Pods-App.modulemap`
      - Generating umbrella header at `../../../../../private/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/Target Support
      Files/Pods-App/Pods-App-umbrella.h`
      - Generating dummy source at `../../../../../private/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/Target Support
      Files/Pods-App/Pods-App-dummy.m`
  - Running post install hooks
  - Writing Xcode project file to `../../../../../private/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/Pods.xcodeproj`
  - Writing Lockfile in `../../../../../var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Podfile.lock`
  - Writing Manifest in `../../../../../private/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/Manifest.lock`

Integrating client project

[!] Please close any current Xcode sessions and use `App.xcworkspace` for this project from now on.

Integrating target `Pods-App` (`../../../../../var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/App.xcodeproj` project)
  Adding Build Phase '[CP] Embed Pods Frameworks' to project.
  Adding Build Phase '[CP] Check Pods Manifest.lock' to project.

-> Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
   Building with `xcodebuild`. 
    $ /usr/bin/xcodebuild clean build -workspace /var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/App.xcworkspace -scheme App -configuration Release
    CODE_SIGN_IDENTITY=- -sdk iphonesimulator -destination id=9FFD6379-A93A-41CD-8823-33BAAA058090
    Build settings from command line:
        CODE_SIGN_IDENTITY = -
        SDKROOT = iphonesimulator12.0

    note: Using new build system

    ** CLEAN SUCCEEDED **

    note: Using new build system
    note: Planning build
    note: Constructing build description
    Build system information
    warning: no rule to process file '/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/iMessageFramework/iMessageFramework/iMessageFramework.xcodeproj/project.xcworkspace/contents.xcworkspacedata' of type 'text.xml' for architecture 'x86_64' (in target 'iMessageFramework')

    Build system information
    warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')

    Build system information
    warning: no rule to process file '/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/iMessageFramework/iMessageFramework/iMessageFramework.xcodeproj/project.pbxproj' of type 'text.pbxproject' for architecture 'x86_64' (in target 'iMessageFramework')

    Build system information
    warning: duplicate output file '/Users/kevin/Library/Developer/Xcode/DerivedData/App-eczliqjaivhugkduytczufeyffib/Build/Products/Release-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist' on task: ProcessInfoPlistFile /Users/kevin/Library/Developer/Xcode/DerivedData/App-eczliqjaivhugkduytczufeyffib/Build/Products/Release-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist /var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/Target Support Files/iMessageFramework/iMessageFramework-Info.plist (in target 'iMessageFramework')

    Build system information
    error: Multiple commands produce '/Users/kevin/Library/Developer/Xcode/DerivedData/App-eczliqjaivhugkduytczufeyffib/Build/Products/Release-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist':
    1) Target 'iMessageFramework' (project 'Pods') has copy command from '/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/iMessageFramework/iMessageFramework/iMessageFramework/Info.plist' to '/Users/kevin/Library/Developer/Xcode/DerivedData/App-eczliqjaivhugkduytczufeyffib/Build/Products/Release-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist'
    2) Target 'iMessageFramework' (project 'Pods') has process command with output '/Users/kevin/Library/Developer/Xcode/DerivedData/App-eczliqjaivhugkduytczufeyffib/Build/Products/Release-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist'

    ** BUILD FAILED **

   Testing with `xcodebuild`. 
 -> iMessageFramework (1.0.0)
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | [iOS] xcodebuild:  note: Planning build
    - NOTE  | [iOS] xcodebuild:  note: Constructing build description
    - NOTE  | [iOS] xcodebuild:  warning: no rule to process file 'iMessageFramework/iMessageFramework/iMessageFramework.xcodeproj/project.xcworkspace/contents.xcworkspacedata' of type 'text.xml' for architecture 'x86_64' (in target 'iMessageFramework')
    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')
    - NOTE  | [iOS] xcodebuild:  warning: no rule to process file 'iMessageFramework/iMessageFramework/iMessageFramework.xcodeproj/project.pbxproj' of type 'text.pbxproject' for architecture 'x86_64' (in target 'iMessageFramework')
    - NOTE  | [iOS] xcodebuild:  warning: duplicate output file '/Users/kevin/Library/Developer/Xcode/DerivedData/App-eczliqjaivhugkduytczufeyffib/Build/Products/Release-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist' on task: ProcessInfoPlistFile /Users/kevin/Library/Developer/Xcode/DerivedData/App-eczliqjaivhugkduytczufeyffib/Build/Products/Release-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist Target Support Files/iMessageFramework/iMessageFramework-Info.plist (in target 'iMessageFramework')
    - NOTE  | [iOS] xcodebuild:  error: Multiple commands produce '/Users/kevin/Library/Developer/Xcode/DerivedData/App-eczliqjaivhugkduytczufeyffib/Build/Products/Release-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist':

Pods workspace available at `/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/App.xcworkspace` for inspection.

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 1 error.

/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/command/spec/lint.rb:94:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.0.beta.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.6.0.beta.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

当我导航到 cocoapods 生成的临时工作区文件时,我收到了这个错误:

Showing All Messages
:-1: Multiple commands produce '/Users/kevin/Library/Developer/Xcode/DerivedData/App-eczliqjaivhugkduytczufeyffib/Build/Products/Debug-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist':
1) Target 'iMessageFramework' (project 'Pods') has copy command from '/var/folders/yx/cl0s1g4n5d17k4vqv1f860mh0000gn/T/CocoaPods-Lint-20180921-37841-e4zicu-iMessageFramework/Pods/iMessageFramework/iMessageFramework/iMessageFramework/Info.plist' to '/Users/kevin/Library/Developer/Xcode/DerivedData/App-eczliqjaivhugkduytczufeyffib/Build/Products/Debug-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist'
2) Target 'iMessageFramework' (project 'Pods') has process command with output '/Users/kevin/Library/Developer/Xcode/DerivedData/App-eczliqjaivhugkduytczufeyffib/Build/Products/Debug-iphonesimulator/iMessageFramework/iMessageFramework.framework/Info.plist'

【问题讨论】:

  • 不确定s.source_files = "iMessageFramework/**/*" 引用的来源中是否有Info.plist 文件。如果它在那里,然后尝试通过执行 s.source_files = "iMessageFramework/**/*.{swift}" 从源中删除 Info.plist 文件
  • 感谢工作!

标签: xcode cocoapods


【解决方案1】:

podspec 包含 s.source_files = "Constrictor/Constrictor/**/*" 包括所有文件,包括正在添加的 Info.plist 文件,就好像它们是源文件一样。

要么将文件移出 glob,要么使用 s.exclude_files = "Projectname/Projectname/*.plist" 从编译中排除这些文件。

【讨论】:

  • 谢谢大家,我已经设法解决了。很抱歉没有结束这个问题!
【解决方案2】:

将以下脚本添加到 PodSpec 文件。它应该可以解决问题。

s.pod_target_xcconfig = {
    'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
  }
  s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }

【讨论】:

    猜你喜欢
    • 2017-08-28
    • 1970-01-01
    • 2019-02-10
    • 1970-01-01
    • 1970-01-01
    • 2021-09-04
    • 2014-11-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多