Nimble: Can't compile Nimble pod for tvOS

Created on 19 May 2017  Â·  4Comments  Â·  Source: Quick/Nimble

  • [x] I have read CONTRIBUTING and have done my best to follow them.

What did you do?

Add Nimble as a dependency to tvOS unit tests target via CocoaPods

What did you expect to happen?

Xcode should compile Nimble when compiling tvOS unit tests target it was added to

What actually happened instead?

Xcode can't compile Nimble-tvOS framework added by CocoaPods. Build fails with error:

UnderControl/Pods/Nimble/Sources/Nimble/Nimble.h:6:9: Include of non-modular header inside framework module 'Nimble.Nimble': 'UnderControl/Pods/Nimble/Sources/Lib/CwlPreconditionTesting/CwlPreconditionTesting/Mach/CwlPreconditionTesting.h'

Environment

List the software versions you're using:

  • Quick: 1.1.0
  • Nimble: 7.0.0
  • Xcode Version: 8.3.2 (8E2002)
  • Swift Version: 3.1 (Xcode Default)
  • Cocoapods: 1.2.1

Project that demonstrates the issue

darrarski/UnderControl

The project contains several unit tests targets:

  • UnderControlTests-iOS
  • UnderControlTests-macOS
  • UnderControlTests-tvOS

All tests targets have Nimble dependency added via CocoaPods. UnderControlTests-iOS and UnderControlTests-macOS compiles with Nimble and runs tests without an issue. The only problem is with UnderControlTests-tvOS target, which Xcode can't compile due to mentioned error.

What I tried to do in order to solve the issue

I noticed that some files are not included in Nimble-tvOS framework, but are included in both Nimble-iOS and Nimble-OSX frameworks. I tried to add those files manually to Nimble-tvOS framework:

  • CwlPreconditionTesting.h
  • CwlCatchException.h
  • CwlBadInstructionException.swift
  • CwlDarwinDefinitions.swift
  • CwlCatchBadInstruction.swift

Eventually I've got to the point where Nimble-tvOS can't be build because of this error:

CwlCatchBadInstruction.swift:106:5: 'mach_msg' is unavailable

Not sure what I am doing ¯\__(ツ)_/¯ so decided to look for help here.

Most helpful comment

Sorry to bump this but seeing this issue in XCode 9 again, with Nimble 7.0.2

All 4 comments

Hey @darrarski,

I cloned the repo you linked to and was able to build UnderControlTests-tvOS target:

  • git clone https://github.com/darrarski/UnderControl
  • pod install
  • open UnderControl.xcworkspace
  • Select UnderControlTests-tvOS
  • ⌘U and see tests pass

Although I'm using Xcode 8.3.3 (8E3004b). Did you try cleaning your derived data?

It looks like the problem was somehow connected to Xcode version. I tried cleaning up derived data and reinstalling pods several times, but on Xcode 8.3.2 build was always failing. Now I am using Xcode 8.3.3 (latest stable version at the moment) and it compiles just fine.

I am closing this issue.

Thanks for following up and closing the issue. 😀

  • Jeff

Sent from my iPhone

On Jun 27, 2017, 3:53 AM -0700, Dariusz Rybicki notifications@github.com, wrote:

Closed #430.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Sorry to bump this but seeing this issue in XCode 9 again, with Nimble 7.0.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ikesyo picture ikesyo  Â·  3Comments

msaehn picture msaehn  Â·  5Comments

ikesyo picture ikesyo  Â·  4Comments

hamchapman picture hamchapman  Â·  7Comments

aaroncrespo picture aaroncrespo  Â·  10Comments