Subito-it / SBTUITestTunnel

Enable network mocks and more in UI Tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot build project using SBTUITestTunnel as SPM

shamanec opened this issue · comments

  1. Added SBTUITestTunnel as SPM according to the installation process.
  2. Set up the preprocessor macro settings according to the setup process.
  3. When I try to build the project I get the following error:
    The package product ‘SBTUITestTunnelServer’ cannot be used as a dependency of this target because it uses unsafe build flags.

Did you add the master branch or did you pin to a tag? BTW Xcode 13 is required when using SPM (exactly because of this)

I used the master branch, but I was trying to compile with Xcode 12.5 so probably this is the reason I encounter a failure.. Thanks for the heads up, I'll see if I can do it using Xcode 13 and close the issue!

Managed to build successfully on Xcode 13, now off to try out this amazing project. Thank you again for the information!

Hmm. I'm on master branch and using XCode 13. Same error. Any clues how to avoid it?

Hmm again. Found this in Xcode 13 what's new: Root packages and branch-based package dependencies can now use unsafeFlags in their target settings. (53679279).

Did you add the SPM using the Xcode UI or with Package.swift file? Did you clean your DerivedData folder? To switch to Xcode 13 I completely removed my older Xcode versions and the whole ~/Library/Developer folder before I managed to get it working. Also check if you are using latest Swift version bundled with Xcode 13 and that your build tools are switched to the new Xcode app - 'sudo xcode-select --switch ~/Applications/Xcode13.app' (if I remember correctly). My Xcode is 13.2.1 but I doubt this makes a difference :)

Yeah, I've first added it by version. Seen this bug, added it by branch. It doesn't work. Then I cleaned everything including Derived Data and now app builds. SPM is quite difficult to use IMHO.

Glad to hear you got it working!

commented

Hello.

When running the test that's using SBTUITestTunnel I'm getting the error:

error: The package product 'SBTUITestTunnelClient' cannot be used as a dependency of this target because it uses unsafe build flags. (in target 'UITests' from project 'XXX')

I'm using SPM and this version 👇
image

I build the project with Xcode 13.3.1
I tried cleaning the derived data and build folders but that didn't help.