为什么Spec lint抛出错误Xcode构建失败:返回了失败的退出代码?

时间:2018-09-21 15:25:13

标签: xcode cocoapods

我试图通过cocoapods创建一个自定义框架,以在我的Xcode项目中使用。我遵循了此处提供的指南:https://guides.cocoapods.org/making/specs-and-specs-repo.html

当我尝试整理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'

2 个答案:

答案 0 :(得分:1)

  

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

     

将文件移至全局之外,或使用s.exclude_files =“ Projectname / Projectname / *。plist”从编译中排除这些文件。

答案 1 :(得分:0)

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

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