fastlane: Unable to import/use SnapshotHelper.swift in Objective-C project

Original issue by @DipenPanchasara - Imported from fastlane/snapshot#441

I configured snapshot and generated SnapshotHelper.swift, added it to my Test Target and writing following code in Test.m file throws error

XCUIApplication *app = [[XCUIApplication alloc] init];
[Snapshot setupSnapshot:app];
[app launch];

error : FastlaneDemoUITests.m:33:6: Use of undeclared identifier ‘Snapshot’

It doesn’t create ProductModule Header.

import “FastlaneDemo-Swift.h”

It also throws FastlaneDemoUITests.m:11:9: 'FastlaneDemo-Swift.h' file not found

XCode : 7.2 Defines Module : YES Product Module Name : FastlaneDemoUITests

kindly advise what to do?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 15 (2 by maintainers)

Most upvoted comments

As a temporary workaround for those, who can’t make bridging in Xcode to work, I can suggest to try objective c variant of SnapshotHelper class. It can be found here: https://gist.github.com/vovkasm/9620d9105d0869d1debb Hope it helps also for people, who reported #1657, #1701

Thanks, @ConfusedVorlon and @TKBurner! I’ll check if this fixes our issue and report back.

I’m hoping that maybe this solves another issue we’ve been having running Snapshot with AWS.

I hit exactly this issue.

@CareerFairPlus the bridging header created in the UITests bundle is not the header required for snapshot.

In order for this to work for me, I had to create a new scheme based on the UITest target (scheme dropdown / new scheme / select UITest target) now run this scheme

this builds the dependencies, and seems to build or find the bridging header for snapshot. Once this has been built once, everything works correctly for me.