I'm trying to run the UItests for my app but it's crashing as soon as it loads. Here's the error.
2018-09-29 16:19:49.577151+1000 xxxUITests-Runner[6007:69633] (dlopen_preflight(/Users/Acc/Library/Developer/Xcode/DerivedData/xxx-bjuwemcifadxhlhgojgfktmmades/Build/Products/Debug-iphonesimulator/xxxUITests-Runner.app/PlugIns/xxxUITests.xctest/xxxUITests): Library not loaded: @rpath/libswiftContacts.dylib
Referenced from: /Users/Acc/Library/Developer/Xcode/DerivedData/xxx-bjuwemcifadxhlhgojgfktmmades/Build/Products/Debug-iphonesimulator/xxxUITests-Runner.app/PlugIns/xxxUITests.xctest/Frameworks/MapboxGeocoder.framework/MapboxGeocoder
Reason: image not found)
I'm using CocoaPods(1.6.0.beta.1) to install my frameworks. I'm running Xcode10 with swift 4.2 and IOS 12. Git is used as version control with other developers (Perhaps there're conflicts?).
My target app works perfectly, both on a simulator and a real phone, and so does my unit tests. But my UITest target fails as soon as it launches up. This problem happens on both a simulator and a real machine.
There have been many posts on the issue before, but none of them have helped me so far. I've had 2 isolated occurrences before, the first time I've solved by adding dependencies into my pod file for the UITest unit, and the second time by simply removing my target and copy & pasting the classes back into the new target (unconstructive, but last resort). I can do the same this time as well but it's a bit of a waste of time and I'm afraid that this will crop up again in the future.
This is what I've done so far:
Clean Xcode builds folder and deleted derived data, IOS device logs, and User Data folders.
Restarted Xcode, Mac, as well as my device and simulators, and recloned repository, and pod update && pod install
Have 'Always embed swift standard libraries' as yes
Checked my Target Application is correct
Made sure offending framework (MapboxGeocoder.framework) is included in Embed Pod Frameworks