Linked Questions

Popular Questions

I'm willing to add unit and UI tests to my app.

I first configured unit tests with success, I tried to do the same with UI tests. Here is my Podfile, after adding a new UI Testing Bundle target :

platform :ios, '8.0'
use_frameworks!
inhibit_all_warnings!

def shared_pods
pod 'Bolts'
pod 'Branch'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'GoogleAnalytics'
pod 'GooglePlaces'
pod 'Parse'
pod 'Toast-Swift'
end

target 'MyTarget' do
shared_pods
end

target 'MyTargetUITests' do
shared_pods
end

target 'MyTargetUnitTests' do
shared_pods
end

However, when I try to run the automatically created MyProjectUITests test case, which only contains the basic setup and without even a @testable import MyProject:

import XCTest

class MyProjectUITests: XCTestCase {

    override func setUp() {
        continueAfterFailure = false
        XCUIApplication().launch()
    }
}

I'm getting this error:

Running tests... The bundle “MyProjectUITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.

(dlopen_preflight(/var/containers/Bundle/Application/5A1FE39F-E675-4A47-9BF4-FBCDB96F5821/MyProjectUITests-Runner.app/PlugIns/MyProjectUITests.xctest/MyProjectUITests): Library not loaded: @rpath/libswiftSwiftOnoneSupport.dylib

Referenced from: /private/var/containers/Bundle/Application/5A1FE39F-E675-4A47-9BF4-FBCDB96F5821/MyProjectUITests-Runner.app/PlugIns/MyProjectUITests.xctest/Frameworks/Toast_Swift.framework/Toast_Swift

Reason: image not found)

What is wrong? Thanks for your help.

EDIT : for information, it works fine when I remove that Toast_swift pod from my UI test target and let it only in my app and unit test targets.

Related Questions