Cocoapods: Library fails 'lib lint' because of a missing bundle identifier with Xcode 8

Created on 15 Sep 2016  Â·  7Comments  Â·  Source: CocoaPods/CocoaPods

Attempting to push or lint a library built with Xcode 8 (Swift 3) fails.

What did you do?

I tried to push SwiftyUserDefaults

It fails with a cryptic error:

$ pod _1.1.0.rc2_ trunk push                                                                                                      

[!] Found podspec `SwiftyUserDefaults.podspec`
Updating spec repo `master`
Validating podspec
 -> SwiftyUserDefaults (3.0.0)
    - ERROR | [tvOS] unknown: Encountered an unknown error (Invalid OS `tvos`, valid values are ios, watchos) during validation.

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

Same thing happens with lib lint:

$ pod _1.1.0.rc2_ lib lint --no-clean                                                                                              ~/Documents/Open Source/SwiftyUserDefaults

 -> SwiftyUserDefaults (3.0.0)
    - ERROR | [tvOS] unknown: Encountered an unknown error (Invalid OS `tvos`, valid values are ios, watchos) during validation.

Pods workspace available at `/var/folders/p3/bmv7xw694031xf9cvm23670r0000gn/T/CocoaPods/Lint/App.xcworkspace` for inspection.

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

The problem appears to be with CP-generated Xcode project for verifying the pod — it doesn't get the bundle identifier set in build settings: https://twitter.com/radexp/status/776196022548717569

CocoaPods Environment

Stack

   CocoaPods : 1.1.0.rc.2
        Ruby : ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]
    RubyGems : 2.4.5.1
        Host : Mac OS X 10.11.6 (15G1004)
       Xcode : 8.0 (8A218a)
         Git : git version 2.8.4 (Apple Git-73)
Ruby lib dir : /Users/radex/.rbenv/versions/2.2.3/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 9cfe72bca76000e90c961d8a2032436b8e4b6faa

Installation Source

Executable Path: /Users/radex/.rbenv/versions/2.2.3/bin/pod

Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-playgrounds : 0.1.0
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.0.0
cocoapods-try         : 1.1.0

Project that demonstrates the issue

Saved CP-generated Xcode project: https://dl.dropboxusercontent.com/u/7133037/Lint.zip

Library: https://github.com/radex/SwiftyUserDefaults/tree/9be965f0188e79a14738e6dd32511c0461c04b56

Most helpful comment

Okay, I'm a total dummy.

The issue was that I didn't have any Apple TV simulators set up. That's it. All the other errors were unrelated.

facepalm

In retrospect, I should've paid more attention to the --verbose logs:

    - ERROR | [tvOS] unknown: Encountered an unknown error (Invalid OS `tvos`, valid values are ios, watchos
/Users/radex/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fourflusher-1.0.1/lib/fourflusher/find.rb:85:in `usable_simulators'
/Users/radex/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fourflusher-1.0.1/lib/fourflusher/find.rb:67:in `simulator'
/Users/radex/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fourflusher-1.0.1/lib/fourflusher/xcodebuild.rb:7:in `destination'

The error comes from fourflusher, not xcodebuild.

All 7 comments

Hrm, I've given this a run on my machine and I'm not seeing this:

screen shot 2016-09-15 at 9 18 14 am

OK, I'm investigating further.

  • I cleaned all of DerivedData, restarted Xcode, no change.
  • I opened the project, added the bundle identifier build setting manually. Still fails.

screen shot 2016-09-15 at 18 02 52

  • I set the development team. No change.
  • I put on --verbose while doing lib lint. iOS and OS X seems to go fine. it's just tvOS.

And here's something interesting in those error messages:

Failed to create provisioning profile. There are no devices registered in your account on the developer website. Plug in and select a device to have Xcode register it.
No profiles for 'test.cocoapods.blah' were found:  Xcode couldn't find a provisioning profile matching 'test.cocoapods.blah'.
Code signing is required for product type 'Application' in SDK 'tvOS 10.0'

Could it be that Xcode needs to generate a provisioning profile to build this test project, but can't do so because none of my development teams actually have any tvOS devices in Apple Developer Portal?

Could it be that Xcode needs to generate a provisioning profile to build this test project, but can't do so because none of my development teams actually have any tvOS devices in Apple Developer Portal?

I checked and indeed I have no Apple TVs in ADP. If someone sent me a valid Apple TV UUID I could check if this fixes it…

I have the same issue

Digging deeper.

@austinate was kind enough to lend me his Apple TV UUID.

Validation still fails the same way:

SwiftyUserDefaults » master » pod _1.1.0.rc2_ lib lint --no-clean                                                                                                                                                              

 -> SwiftyUserDefaults (3.0.0)
    - ERROR | [tvOS] unknown: Encountered an unknown error (Invalid OS `tvos`, valid values are ios, watchos) during validation.

Pods workspace available at `/var/folders/p3/bmv7xw694031xf9cvm23670r0000gn/T/CocoaPods/Lint/App.xcworkspace` for inspection.

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

When I open the Xcode project, it too fails. I still have to add the bundle identifier and set the development team manually, and I get further this way, but still fails like so:

screen shot 2016-09-19 at 12 24 45

Which could be an artifact of building manually instead of via xcodebuild, but it's still strange, because @orta says the validation passes just fine for him...

I'm running out of ideas of how our setups could be different:

  • OS X version (I'm on El Capitan)
  • number of development teams (I have two)

Okay, I'm a total dummy.

The issue was that I didn't have any Apple TV simulators set up. That's it. All the other errors were unrelated.

facepalm

In retrospect, I should've paid more attention to the --verbose logs:

    - ERROR | [tvOS] unknown: Encountered an unknown error (Invalid OS `tvos`, valid values are ios, watchos
/Users/radex/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fourflusher-1.0.1/lib/fourflusher/find.rb:85:in `usable_simulators'
/Users/radex/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fourflusher-1.0.1/lib/fourflusher/find.rb:67:in `simulator'
/Users/radex/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/fourflusher-1.0.1/lib/fourflusher/xcodebuild.rb:7:in `destination'

The error comes from fourflusher, not xcodebuild.

Thanks for writing this down!

I ran into the exact same thing. But with the help of this issue, it didn't cost me much time. 😄

Was this page helpful?
0 / 5 - 0 ratings