Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Swift CocoaPods pod spec lint Fails on Embed Pods Frameworks

I'm getting the following error when trying to run pod spec lint --verbose:

sent 1312397 bytes  received 106 bytes  2625006.00 bytes/sec
total size is 1311832  speedup is 1.00
/var/folders/3d/v0m_90ty4mg1opbynpnjjvzh2010gm/T/CocoaPods-Lint-20181015-62030-oljqd-MySwiftPackage/Pods/Target Support Files/Pods-App/Pods-App-frameworks.sh: line 104: EXPANDED_CODE_SIGN_IDENTITY: unbound variable
Command PhaseScriptExecution failed with a nonzero exit code

    ** BUILD FAILED **


    The following build commands failed:
        PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/myuser/Library/Developer/Xcode/DerivedData/App-loplmnuztwibrzfqgadqoxucytrz/Build/Intermediates.noindex/App.build/Release/App.build/Script-09EB8340PON5K18DNW0C63DQ.sh
    (1 failure)
   Testing with `xcodebuild`. 
 -> MySwiftPackage (0.1.0)
    - WARN  | summary: The summary is not meaningful.
    - WARN  | description: The description is shorter than the summary.
    - WARN  | url: The URL (https://github.com/fishcharlie/MySwiftPackage) is not reachable.
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | xcodebuild:  note: Planning build
    - NOTE  | xcodebuild:  note: Constructing build description
    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')
    - WARN  | xcodebuild:  MySwiftPackage/MySwiftPackage/ViewControllers/Shared/MyFirstViewController.swift:102:37: warning: conditional cast from 'UIViewController' to 'MyViewController' (aka 'UIViewController') always succeeds
    - WARN  | xcodebuild:  MySwiftPackage/MySwiftPackage/ViewControllers/Shared/MySecondViewController.swift:145:37: warning: conditional cast from 'UIViewController' to 'MyViewController' (aka 'UIViewController') always succeeds
    - ERROR | [OSX] xcodebuild: Returned an unsuccessful exit code.

Analyzed 1 podspec.

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

I know I have a few warnings that I can clean up. But there is only one error that I'm getting, which is - ERROR | [OSX] xcodebuild: Returned an unsuccessful exit code.. And above that it says that Embed Pods Frameworks was the cause of failure.

Not quire sure how to debug this since I can build and run the example projects in Xcode just fine.

Below I have attached my Podspec as well.

Pod::Spec.new do |s|
  s.name             = 'MySwiftPackage'
  s.version          = '0.1.0'
  s.summary          = 'A short description of MySwiftPackage.'

  s.description      = <<-DESC
TODO: Add long description of the pod here.
                       DESC

  s.homepage         = 'https://github.com/fishcharlie/MySwiftPackage'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'fishcharlie' => '[email protected]' }
  s.source           = { :git => 'https://github.com/fishcharlie/MySwiftPackage.git', :tag => s.version.to_s }
  s.social_media_url = 'https://twitter.com/char_fish'

  s.ios.deployment_target = '9.0'
  s.osx.deployment_target = '10.11'
  s.swift_version = '4.2'

  s.source_files = 'MySwiftPackage/Classes/**/*', 'MySwiftPackage/ViewControllers/Shared/**/*'
  s.ios.source_files = 'MySwiftPackage/ViewControllers/iOS/**/*'
  s.osx.source_files = 'MySwiftPackage/ViewControllers/macOS/**/*'
  s.resources = 'MySwiftPackage/Assets/**/*.{ttf,xcassets}'

  s.dependency 'Alamofire', '4.7.3'
  s.dependency 'Bond', '6.10.2'
  s.ios.dependency '1PasswordExtension', '1.8.5'
end

Any ideas on how to fix/debug this?

like image 731
Charlie Fish Avatar asked Oct 13 '18 16:10

Charlie Fish


2 Answers

The error should be about line 104: EXPANDED_CODE_SIGN_IDENTITY: unbound variable

The solution (as stated in Issue 7708 on github/Cocoapods ) should be to add the following User-Defined Settings to project:

EXPANDED_CODE_SIGN_IDENTITY="-"
EXPANDED_CODE_SIGN_IDENTITY_NAME="-"`
like image 142
Umberto Migliore Avatar answered Oct 13 '22 13:10

Umberto Migliore


Try adding the flag --no-clean. This flag makes lint leave the build directory intact for inspection so you can debug that build failure in a workspace which may be more familiar and give you more information.

Looks like they fixed this for xcode 10 in pr github.com/CocoaPods/CocoaPods/pull/7720, you could try upgrading to 1.6.0, or downgrading xcode to 9.4.

like image 1
John Franke Avatar answered Oct 13 '22 11:10

John Franke