facebookarchive / ios-snapshot-test-case

Snapshot view unit tests for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot Build In Xcode 7.1

Adlai-Holler opened this issue · comments

Using Cocoapods, pointing at ~> 2.0.5, the module will no longer build for me with the error /Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.h:11:9: Include of non-modular header inside framework module 'FBSnapshotTestCase.FBSnapshotTestCase'.

It's complaining because FBSnapshotTestCase.h imports the non-modular header FBSnapshotTestCasePlatform.h. I'll look into this when I get time but if someone else can help that'd be great!

Thanks for letting me know, I will look at and fix it as soon as possible. From this stackoverflow thread it seems that you can disable this error. Is that something you can do until I provide a fix?

Awesome, I'm glad to know you're on it! That fix isn't working for me but at the moment it's not urgent. I'll comment on here if it starts blocking work or what have you.

@Adlai-Holler can you try patching #127 to see if resolves the issue for you?

Here's a workaround until this is resolved. Add this to the end of your Podfile.

post_install do |installer|
  `find Pods -regex 'Pods/FBSnapshotTestCase.*\\.h' -print0 | xargs -0 sed -i '' 's/\\(<\\)FBSnapshotTestCase\\/\\(.*\\)\\(>\\)/\\"\\2\\"/'`
end

It converts #import <FBSnapshotTestCase FBSnapshotTestCasePlatform.h> to #import "FBSnapshotTestCasePlatform.h" in FBSnapshotTestCase.h. You should then be able to build in Xcode 7.1.

See CocoaPods/CocoaPods#4420.

I just pushed 2.0.6, please confirm that your issue is resolved

Works like a charm