"Framework not found TwitterCore" while running Unit Tests

ios
xcode
testing

#1

I’ve installed Twitter SDK (iOS) manually (but not via Pods or Fabric).

Followed all the instructions to Compose Tweets from my app and succeeded, everything works perfectly: running and building app gives no errors, tweets are being sent etc.

Then, I tried running Unit Tests (note: I don’t use Twitter at all in my Unit Tests). Building tests didn’t succeed and showed this error:

ld: framework not found TwitterCore for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: framework not found TwitterCore for architecture arm64

The main point here is that why should it even try to use framework TwitterCore in the Tests if I’m not using Twitter inside my Unit Tests.

After troubleshooting I found a solution: open Build Phases of MyAppTests target > Link Binary With Libraries > add TwitterCore > run tests > tests succeed.

Please also note that I didn’t need to add TwitterKit lib though, but only TwitterCore.

I’m not sure yet if this is Xcode or Twitter’s issue. But I decided to point this problem out.

Basically, my issue is that I don’t want to have TwitterCore lib in the Test target since it’s not right and makes project being kind of illogical.

Looking forward to hearing your opinion. Thanks in advance!