Tyler-Keith-Thompson / CucumberSwift

A lightweight swift Cucumber implementation
https://tyler-keith-thompson.github.io/CucumberSwift/documentation/cucumberswift/
MIT License
74 stars 19 forks source link

Missing required module 'CucumberSwift_ObjC' in new swift UITest target #45

Closed richardsimkins closed 2 years ago

richardsimkins commented 2 years ago

Describe the bug Compiler fails to build test target with the error "Missing required module 'CucumberSwift_ObjC'"

To Reproduce Steps to reproduce the behavior:

  1. I created a new UITest target.
  2. I added the CucumberSwift package dependency to the project.
  3. I included feature files in a reference folder "Features".
  4. I created a swift file with the code in the screenshot.
  5. I run the test target to start a build.
  6. The build fails with the error.

Expected behavior The build should succeed without error.

Screenshots

Screenshot 2022-05-18 at 14 58 16 Screenshot 2022-05-18 at 16 13 33

Additional context Add any other context about the problem here.

richardsimkins commented 2 years ago

I have tried using the Cocoapod pod and it builds fine with no other change.

I would prefer to be using Swift Package Manager if possible since we have been looking to move away from using Cocoapods.

Tyler-Keith-Thompson commented 2 years ago

I'll look into this more when I can. This weekend I'll be up on a mountain with no internet access.

Just in case it's something with your local environment can you clear your package cache? The Objective-C target is a transitive dependency so it should be there.

Does the sample repo work for you?

Hopefully some of that can help before I'm able to take a better look

richardsimkins commented 2 years ago

Thanks for the quick reply. I'll try what you suggest and get back to you. Enjoy your mountain climb.

Tyler-Keith-Thompson commented 2 years ago

Did any of those things work? I was not able to reproduce this problem using the sample app.

richardsimkins commented 2 years ago

Sorry for the delay in getting back to you.

The issue I was having was I had linked the library to the app's target and not the test target.

Thanks for your help.