Added a KIF UI Testing target to my project
I expect to be able to run my UI Test target using CP's generated frameworks
The test bundle cannot be loaded:
2016-03-10 17:20:03.344 FrameworksIntegration[4274:1256151] The bundle “FrameworksIntegrationKIFTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2016-03-10 17:20:03.345 FrameworksIntegration[4274:1256151] (dlopen_preflight(/Users/michele/Library/Developer/Xcode/DerivedData/FrameworksIntegration-cneyifjmzbeardhlhwpbojjoaxrp/Build/Products/Debug-iphonesimulator/FrameworksIntegrationKIFTests-Runner.app/PlugIns/FrameworksIntegrationKIFTests.xctest/FrameworksIntegrationKIFTests): Library not loaded: @rpath/KIF.framework/KIF
Referenced from: /Users/michele/Library/Developer/Xcode/DerivedData/FrameworksIntegration-cneyifjmzbeardhlhwpbojjoaxrp/Build/Products/Debug-iphonesimulator/FrameworksIntegrationKIFTests-Runner.app/PlugIns/FrameworksIntegrationKIFTests.xctest/FrameworksIntegrationKIFTests
Reason: image not found)
This is (likely) due to a different TARGET_BUILD_DIR causing @rpath to be further down the tree from the main CONFIGURATION_BUILD_DIR where the frameworks are:
TARGET_BUILD_DIR = /Users/michele/Library/Developer/Xcode/DerivedData/FrameworksIntegration-gqwvjrovjkymuvgxnryvnnwzcchu/Build/Products/Debug-iphoneos/FrameworksIntegrationKIFTests-Runner.app//PlugIns
Aka Xcode is complaining that KIF.framework is not in PlugIns.
platform :ios, '9.0'
use_frameworks!
target 'FrameworksIntegration' do
pod 'CocoaLumberjack'
end
target 'FrameworksIntegrationKIFTests' do
pod 'KIF'
pod 'CocoaLumberjack'
end
This became an issue in beta4 when frameworks moved out of the Pods-TargetName folders and into their own folders. Thankfully beta3 allows us to run tests. We cannot update to a newer version until the paths issues are resolved.
I've done a lot of digging so let me know if other info is needed.
Excellent investigation so far. :+1: I'm looking further into that. But it's really odd that the test binary is not picking up the frameworks from the xctest bundle, where they are all back in a flat structure.
Okay, so for UI tests Xcode generates an on-the-fly app, which uses the xctest bundle as plugin. It overwrites the TARGET_BUILD_DIR for that purpose in an undocumented way. :tada: We're relying in the generated embed frameworks script on CONFIGURATION_BUILD_DIR as destination, which is indeed not the correct var. Fix is on the way, you might be able to adopt it manually if needed until it is shipped.
Solution: Just set manually your Host Application

Is this issue fixed? I am facing the same issue and not able to find a solution.
Most helpful comment
Is this issue fixed? I am facing the same issue and not able to find a solution.